Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
node-version-file: 'ui/package.json'
- uses: actions/setup-python@v5
with:
python-version: "3.7"
python-version: "3.9"
Comment thread
wtobis-splunk marked this conversation as resolved.
- run: |
python3 -m venv .venv
source .venv/bin/activate
Expand Down Expand Up @@ -100,7 +100,7 @@ jobs:
with:
name: Splunk_TA_Example
path: build/package
- uses: splunk/appinspect-cli-action@v2.8
- uses: splunk/appinspect-cli-action@v2.15.0
with:
app_path: build/package
included_tags: ${{ matrix.tags }}
Expand All @@ -120,7 +120,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.7"
python-version: "3.9"
- uses: actions/download-artifact@v4
with:
name: Splunk_TA_Example-raw-output
Expand All @@ -138,7 +138,7 @@ jobs:
run : |
sudo chown -R runner:runner psa-output/Splunk_TA_Example/
chmod u+rwx psa-output/Splunk_TA_Example/
pytest tests/knowledge --splunk-type=external --splunk-app=package/ --splunk-data-generator=tests/knowledge --splunk-host=localhost --splunk-port=8089 --splunk-user=admin --splunk-password=Chang3d! --splunk-hec-token=4a8a737d-5452-426c-a6f7-106dca4e813f
pytest tests/knowledge --splunk-type=external --splunk-app=package/ --splunk-data-generator=tests/knowledge --splunk-host=localhost --splunk-port=8089 --splunk-user=admin --splunk-password=Chang3d! --splunk-hec-token=4a8a737d-5452-426c-a6f7-106dca4e813f --ignore-errors-not-related-to-addon=tests/knowledge/.ignore_errors_not_related_to_addon
- name: Set output if steps failed
run: |
echo "failed=${{ env.failed }}" >> $GITHUB_ENV
Expand All @@ -160,7 +160,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.7"
python-version: "3.9"
- uses: actions/download-artifact@v4
with:
name: Splunk_TA_Example
Expand All @@ -184,4 +184,3 @@ jobs:
echo "failed=${{ env.failed }}" >> $GITHUB_ENV
outputs:
failed: ${{ env.failed }}

8 changes: 1 addition & 7 deletions additional_packaging.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
import os
from os import path


def additional_packaging(addon_name: str) -> None:
# It fixes https://github.com/splunk/splunk-example-ta/actions/runs/11767701819/job/32776693866?pr=2.
file_to_remove = f"output/{addon_name}/lib/__pycache__/socks.cpython-37.pyc"
if path.exists(file_to_remove):
os.remove(file_to_remove)

build_ui_script = os.path.join(
os.path.dirname(os.path.realpath(__file__)), "scripts", "build_ui.sh"
)
if path.exists(build_ui_script):
if os.path.exists(build_ui_script):
os.system(f"chmod +x {build_ui_script}")
return_code = os.system(build_ui_script)
if return_code != 0:
Expand Down
3 changes: 2 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ services:
dockerfile: Dockerfile

splunk:
image: splunk/splunk:latest
image: splunk/splunk:${SPLUNK_VERSION:-10.2.2}
container_name: splunk-example-ta
ports:
- "8000:8000"
Expand All @@ -19,3 +19,4 @@ services:
- SPLUNK_GENERAL_TERMS=${SPLUNK_GENERAL_TERMS:---accept-sgt-current-at-splunk-com}
volumes:
- ./output/Splunk_TA_Example:/opt/splunk/etc/apps/Splunk_TA_Example
- ./tests/splunk-ci-config:/opt/splunk/etc/apps/splunk_ci_test_config
6 changes: 0 additions & 6 deletions package/README.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1 @@
# splunk-example-ta

# Binary File Declaration

lib/charset_normalizer/md__mypyc.cpython-37m-x86_64-linux-gnu.so -- This binary file contains the compiled code related to the Charset Normalizer package that has been generated by the MyPyC tool for Python

lib/charset_normalizer/md.cpython-37m-x86_64-linux-gnu.so -- This binary file contains the compiled code of the Charset Normalizer package, which includes performance optimizations and low-level functionality written in C or C++
7 changes: 4 additions & 3 deletions package/lib/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
splunktaucclib
splunk-sdk
solnlib
splunktaucclib==8.2.0
splunk-sdk==2.1.1
solnlib==7.0.0
packaging==24.0
Comment thread
wtobis-splunk marked this conversation as resolved.
4 changes: 2 additions & 2 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pytest-splunk-addon==5.4.1
pytest-splunk-addon==5.5.3
splunk-add-on-ucc-framework==5.58.0
splunk-add-on-ucc-modinput-test==2.0.0
splunk-add-on-ucc-modinput-test==2.0.5
4 changes: 3 additions & 1 deletion scripts/run_splunk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

SCRIPT_DIR=$(cd $(dirname ${BASH_SOURCE[0]}) && pwd)
REPO_ROOT_DIR=$(cd "$SCRIPT_DIR/.." && pwd)
SPLUNK_VERSION="${1:-${SPLUNK_VERSION:-10.2.2}}"


# running on ARM Mac
Expand All @@ -25,6 +26,7 @@ fi

docker run \
-v "$REPO_ROOT_DIR/psa-output/Splunk_TA_Example:/opt/splunk/etc/apps/Splunk_TA_Example" \
-v "$REPO_ROOT_DIR/tests/splunk-ci-config:/opt/splunk/etc/apps/splunk_ci_test_config" \
-p 8000:8000 \
-p 8088:8088 \
-p 8089:8089 \
Expand All @@ -36,4 +38,4 @@ docker run \
-e "SPLUNK_GENERAL_TERMS=--accept-sgt-current-at-splunk-com" \
-d \
--pull=always \
--name splunk splunk/splunk:${1:-"latest"}
--name splunk "splunk/splunk:$SPLUNK_VERSION"
2 changes: 2 additions & 0 deletions tests/knowledge/.ignore_errors_not_related_to_addon
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
"service":"InitialDatasetGlobalMap"
"location":"genericDatasets/global_datasets_map.go:72"
8 changes: 8 additions & 0 deletions tests/splunk-ci-config/default/app.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[install]
state = enabled

[ui]
is_visible = false

[package]
id = splunk_ci_test_config
4 changes: 4 additions & 0 deletions tests/splunk-ci-config/default/server.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# GitHub-hosted runners have limited disk space. Keep a safety margin while
# allowing searches in this short-lived test-only Splunk instance.
[diskUsage]
minFreeSpace = 500
12 changes: 7 additions & 5 deletions ui/jest.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ export default {
*/
customExportConditions: [""],
},
moduleNameMapper: {
"^jspdf(?:/dist/jspdf\\.es\\.min\\.js)?$":
"<rootDir>/node_modules/jspdf/dist/jspdf.umd.min.js",
// Force module uuid to resolve with the CJS entry point, because Jest does not support package.json.exports. See https://github.com/uuidjs/uuid/issues/451
// uuid: require.resolve("uuid"),
// "\\.(css)$": "<rootDir>/src/mocks/styleMock.js",
},
errorOnDeprecated: true,
// moduleNameMapper: {
// // Force module uuid to resolve with the CJS entry point, because Jest does not support package.json.exports. See https://github.com/uuidjs/uuid/issues/451
// uuid: require.resolve("uuid"),
// "\\.(css)$": "<rootDir>/src/mocks/styleMock.js",
// },
} satisfies Config;
Loading
Loading