Skip to content

Commit

Permalink
chore: improve local testing
Browse files Browse the repository at this point in the history
  • Loading branch information
artemrys committed Feb 25, 2025
1 parent 0c8cc1c commit 49bb2fd
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 61 deletions.
12 changes: 1 addition & 11 deletions .github/workflows/build-test-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -129,17 +129,7 @@ jobs:
with:
python-version: 3.7
- run: curl -sSL https://install.python-poetry.org | python3 - --version 1.5.1
- run: poetry install
- name: build demo add-on
run: |
poetry run ucc-gen \
--source=tests/integration/demo/package \
--config=tests/integration/demo/globalConfig.json \
--ta-version=0.0.1
poetry build
pip install wheel
pip install dist/*.whl --target output/demo/lib
poetry run slim package output/demo
- run: ./scripts/build-demo-addon.sh
- name: install Splunk
run: |
export SPLUNK_PRODUCT=splunk
Expand Down
57 changes: 16 additions & 41 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ solnlib = ">=5"

[tool.poetry.group.dev.dependencies]
pytest = ">=7"
wheel = "*"
splunk-add-on-ucc-framework = ">=5.53.0"
requests = "^2.31.0"
splunk-packaging-toolkit = ">=1"

[build-system]
requires = ["poetry>=1.0.0"]
Expand Down
22 changes: 22 additions & 0 deletions scripts/build-demo-addon.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash
# Copyright 2025 Splunk Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
poetry install
poetry build
poetry run ucc-gen build \
--source=tests/integration/demo/package \
--config=tests/integration/demo/globalConfig.json \
--ta-version=0.0.1
poetry run pip install dist/*.whl --target output/demo/lib
poetry run ucc-gen package --path output/demo
7 changes: 1 addition & 6 deletions tests/integration/demo/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,7 @@
## To run locally

```bash
python3 -m venv .venv
source .venv/bin/activate
pip install splunk-add-on-ucc-framework
pip install splunk-packaging-toolkit
ucc-gen --ta-version=0.0.1
slim package output/demo
./scripts/build-demo-addon.sh
```

Then you will see an archive in the root directory which you can install through Splunk UI.
3 changes: 1 addition & 2 deletions tests/integration/demo/globalConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@
"table": {
"actions": [
"edit",
"enable",
"delete",
"clone"
],
Expand Down Expand Up @@ -110,6 +109,6 @@
"restRoot": "demo",
"version": "0.0.1",
"displayName": "Demo",
"schemaVersion": "0.0.8"
"schemaVersion": "0.0.9"
}
}

0 comments on commit 49bb2fd

Please sign in to comment.