Skip to content

Commit 5c5fdbf

Browse files
authored
fix: update a query for Toggle component (#384)
* chore: separating from ucc-example repository * test(ui): fix issue with alert actions * fix(toggle): update queries to control Toggle * ci: build add-on once * test: remove pytest expect
1 parent d174cf3 commit 5c5fdbf

36 files changed

+6581
-117
lines changed

.github/workflows/build-test-release.yaml

Lines changed: 24 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -97,45 +97,29 @@ jobs:
9797
- uses: actions/setup-python@v4
9898
with:
9999
python-version: 3.7
100-
- name: Install tools
101-
run: |
102-
curl -sSL https://install.python-poetry.org | python3 - --version 1.4.2
103-
- name: Build Package
104-
run: |
100+
- run: curl -sSL https://install.python-poetry.org | python3 - --version 1.4.2
101+
- run: |
105102
poetry install
106103
poetry build
107-
- name: artifact-splunk-unpacked
108-
uses: actions/upload-artifact@v3
104+
- run: |
105+
poetry run ucc-gen build \
106+
--source=tests/testdata/Splunk_TA_UCCExample/package \
107+
--config=tests/testdata/Splunk_TA_UCCExample/globalConfig.json \
108+
--ta-version=0.0.1
109+
- uses: actions/upload-artifact@v3
109110
with:
110111
name: package
111112
path: dist/*
112113
if: always()
113-
114-
prerequisites-ui-tests:
115-
runs-on: ubuntu-latest
116-
outputs:
117-
ta_example_version: ${{ steps.ta-example.outputs.version }}
118-
steps:
119-
- name: Fetch latest version of Splunk_TA example
120-
id: ta-example
121-
run: |
122-
ta_example_version=`basename $(curl -H 'Authorization: token ${{ secrets.GITHUB_TOKEN }}' -s https://api.github.com/repos/splunk/splunk-add-on-for-ucc-example/releases/latest | jq -r '.assets | last | .browser_download_url')`
123-
echo "version=$ta_example_version" >> $GITHUB_OUTPUT
124-
- name: Cache Splunk_TA example
125-
id: cache_ta
126-
uses: actions/cache@v3
114+
- uses: actions/upload-artifact@v3
127115
with:
128-
path: Splunk_TA*.spl
129-
key: ${{ steps.ta-example.outputs.version }}
130-
- name: Download Splunk_TA example
131-
if: steps.cache_ta.outputs.cache-hit != 'true'
132-
run: curl -s https://api.github.com/repos/splunk/splunk-add-on-for-ucc-example/releases/latest | jq -r '.assets | last | .browser_download_url' | wget -i -
116+
name: output
117+
path: output/*
133118

134119
run-ui-tests:
135120
needs:
136121
- meta
137122
- build
138-
- prerequisites-ui-tests
139123
runs-on: ubuntu-latest
140124
permissions:
141125
id-token: write
@@ -146,7 +130,7 @@ jobs:
146130
matrix:
147131
splunk: ${{ fromJson(needs.meta.outputs.matrix_supportedSplunk) }}
148132
browser: ["chrome", "firefox"]
149-
test_suit: [
133+
test_suite: [
150134
"test_splunk_ta_example_addon_logging",
151135
"test_splunk_ta_example_addon_account",
152136
"test_splunk_ta_example_addon_proxy",
@@ -162,31 +146,24 @@ jobs:
162146
with:
163147
name: package
164148
path: dist/
165-
- name: update submodule
166-
run: |
167-
git submodule sync
168-
git submodule update --recursive --remote
169-
- name: Cache Splunk_TA example
170-
id: cache_ta
171-
uses: actions/cache@v3
149+
- uses: actions/download-artifact@v3
172150
with:
173-
path: Splunk_TA*.spl
174-
key: ${{ needs.prerequisites-ui-tests.outputs.ta_example_version }}
175-
- name: Setup for testing
176-
run: |
177-
mkdir output test-results
178-
tar -xvf Splunk_TA*.spl -C output/
179-
pip install git+https://github.com/pixelb/crudini
151+
name: output
152+
path: output/
153+
- run: |
154+
git submodule sync
155+
git submodule update --recursive --remote
180156
- name: Splunk Testing
181157
run: |
158+
mkdir test-results
182159
export SPLUNK_VERSION=${{ matrix.splunk.version }}
183-
SPLUNK_APP_ID=$(crudini --get tests/deps/splunk-add-on-for-ucc-example/package/default/app.conf id name)
160+
SPLUNK_APP_ID=Splunk_TA_UCCExample
184161
export SPLUNK_APP_ID
185-
SPLUNK_APP_PACKAGE=output/$(ls output/)
162+
SPLUNK_APP_PACKAGE=output/Splunk_TA_UCCExample
186163
export SPLUNK_APP_PACKAGE
187164
export TEST_SET=tests/ui
188165
export TEST_BROWSER="${{ matrix.browser }}"
189-
export TEST_SUITE="-k ${{ matrix.test_suit }}"
166+
export TEST_SUITE="-k ${{ matrix.test_suite }}"
190167
export SAUCE_USERNAME="${{ secrets.SAUCE_USERNAME }}"
191168
export SAUCE_PASSWORD="${{ secrets.SAUCE_PASSWORD }}"
192169
export SAUCE_TUNNEL_ID="${{ secrets.SAUCE_TUNNEL_ID }}"
@@ -229,12 +206,12 @@ jobs:
229206
- uses: actions/upload-artifact@v3
230207
if: always()
231208
with:
232-
name: test-results-${{ matrix.splunk }}_${{ matrix.python-version }}_${{ matrix.browser }}_${{ matrix.test_suit }}
209+
name: test-results-${{ matrix.splunk }}_${{ matrix.python-version }}_${{ matrix.browser }}_${{ matrix.test_suite }}
233210
path: test-results/*
234211
- uses: dorny/test-reporter@v1
235212
if: always()
236213
with:
237-
name: test-report-${{ matrix.splunk }}_${{ matrix.python-version }}_${{ matrix.browser }}_${{ matrix.test_suit }}
214+
name: test-report-${{ matrix.splunk }}_${{ matrix.python-version }}_${{ matrix.browser }}_${{ matrix.test_suite }}
238215
path: "test-results/*.xml"
239216
reporter: java-junit
240217

.gitignore

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ dist/
1414
downloads/
1515
eggs/
1616
.eggs/
17-
lib/
1817
lib64/
1918
parts/
2019
sdist/
@@ -30,7 +29,6 @@ MANIFEST
3029
# PyInstaller
3130
# Usually these files are written by a python script from a template
3231
# before PyInstaller builds the exe, so as to inject date/other infos into it.
33-
*.manifest
3432
*.spec
3533

3634
# Installer logs

.gitmodules

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
[submodule "tests/deps/splunk-add-on-for-ucc-example"]
2-
path = tests/deps/splunk-add-on-for-ucc-example
3-
branch = main
4-
url = https://github.com/splunk/splunk-add-on-for-ucc-example
51
[submodule "tests/deps/build/addonfactory_test_matrix_splunk"]
62
path = tests/deps/build/addonfactory_test_matrix_splunk
73
url = https://github.com/splunk/addonfactory_test_matrix_splunk

Dockerfile-saucelabs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,7 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
#Splunk Connect for Syslog (SC4S) by Splunk, Inc.
17-
#
18-
#To the extent possible under law, the person who associated CC0 with
19-
#Splunk Connect for Syslog (SC4S) has waived all copyright and related or neighboring rights
20-
#to Splunk Connect for Syslog (SC4S).
21-
#
22-
#You should have received a copy of the CC0 legalcode along with this
23-
#work. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
2416
FROM circleci/python:3.7
2517
RUN curl https://saucelabs.com/downloads/sc-4.6.2-linux.tar.gz -o /home/circleci/saucelabs.tar.gz
2618
RUN tar -xzf /home/circleci/saucelabs.tar.gz --directory /home/circleci/
27-
CMD /home/circleci/sc-4.6.2-linux/bin/sc -u $SAUCE_USERNAME -k $SAUCE_PASSWORD -i $SAUCE_TUNNEL_ID --no-remove-colliding-tunnels -v --se-port 4445
19+
CMD /home/circleci/sc-4.6.2-linux/bin/sc -u $SAUCE_USERNAME -k $SAUCE_PASSWORD -i $SAUCE_TUNNEL_ID --no-remove-colliding-tunnels -v --se-port 4445

Dockerfile-tests

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,6 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515
#
16-
#Splunk Connect for Syslog (SC4S) by Splunk, Inc.
17-
#
18-
#To the extent possible under law, the person who associated CC0 with
19-
#Splunk Connect for Syslog (SC4S) has waived all copyright and related or neighboring rights
20-
#to Splunk Connect for Syslog (SC4S).
21-
#
22-
#You should have received a copy of the CC0 legalcode along with this
23-
#work. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
2416
FROM ubuntu:latest
2517
RUN mkdir -p /work/tests
2618
RUN mkdir -p /work/test-results/functional
@@ -36,17 +28,13 @@ RUN export DEBIAN_FRONTEND=noninteractive ;\
3628
ENV LANG en_US.utf8
3729

3830
COPY dist /work/dist
39-
COPY tests/pytest-ci.ini /work/pytest.ini
31+
COPY tests/ui/pytest-ci.ini /work/pytest.ini
4032
RUN pip install /work/dist/*.whl
41-
RUN pip install pytest-splunk-addon
42-
RUN pip install pytest-expect
4333
RUN pip install pytest-rerunfailures
4434
COPY tests/entrypoint.sh /
45-
COPY tests/deps/splunk-add-on-for-ucc-example/tests /work/tests
46-
COPY tests/deps/splunk-add-on-for-ucc-example/.pytest.expect /work/.pytest.expect
35+
COPY tests /work/tests
4736
RUN cd /work/tests && ls
4837
RUN cd ../..
49-
COPY tests/deps/splunk-add-on-for-ucc-example/package /work/package
5038

5139
WORKDIR /work
5240

0 commit comments

Comments
 (0)