@@ -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
0 commit comments