|
71 | 71 | runs-on: ubuntu-latest |
72 | 72 | steps: |
73 | 73 | - uses: actions/checkout@v4 |
74 | | - with: |
75 | | - submodules: true |
76 | 74 | - uses: actions/setup-python@v4 |
77 | 75 | with: |
78 | | - python-version: 3.7 |
| 76 | + python-version: "3.7" |
79 | 77 | - run: | |
80 | 78 | curl -sSL https://install.python-poetry.org | python3 - --version 1.5.1 |
81 | 79 | - run: | |
@@ -106,17 +104,14 @@ jobs: |
106 | 104 | --source=tests/testdata/Splunk_TA_UCCExample/package \ |
107 | 105 | --config=tests/testdata/Splunk_TA_UCCExample/globalConfig.json \ |
108 | 106 | --ta-version=0.0.1 |
109 | | - - uses: actions/upload-artifact@v3 |
110 | | - with: |
111 | | - name: package |
112 | | - path: dist/* |
113 | 107 | if: always() |
114 | 108 | - uses: actions/upload-artifact@v3 |
115 | 109 | with: |
116 | 110 | name: output |
117 | 111 | path: output/* |
118 | 112 |
|
119 | 113 | run-ui-tests: |
| 114 | + name: test-ui Splunk ${{ matrix.splunk.version }} -k ${{ matrix.test_suite }} |
120 | 115 | needs: |
121 | 116 | - meta |
122 | 117 | - build |
@@ -145,69 +140,26 @@ jobs: |
145 | 140 | ] |
146 | 141 | steps: |
147 | 142 | - uses: actions/checkout@v4 |
| 143 | + - uses: actions/setup-python@v4 |
148 | 144 | with: |
149 | | - submodules: recursive |
150 | | - - uses: actions/download-artifact@v3 |
151 | | - with: |
152 | | - name: package |
153 | | - path: dist/ |
| 145 | + python-version: "3.7" |
154 | 146 | - uses: actions/download-artifact@v3 |
155 | 147 | with: |
156 | 148 | name: output |
157 | 149 | path: output/ |
158 | | - - run: | |
159 | | - git submodule sync |
160 | | - git submodule update --recursive --remote |
161 | | - - name: Splunk Testing |
| 150 | + - run: curl -sSL https://install.python-poetry.org | python3 - --version 1.5.1 |
| 151 | + - run: poetry install |
| 152 | + - name: Link chromedriver and geckodriver |
| 153 | + # Use installed chromedriver https://github.com/actions/runner-images/blob/main/images/linux/Ubuntu2204-Readme.md |
162 | 154 | run: | |
163 | | - mkdir test-results |
164 | | - export SPLUNK_VERSION=${{ matrix.splunk.version }} |
165 | | - SPLUNK_APP_ID=Splunk_TA_UCCExample |
166 | | - export SPLUNK_APP_ID |
167 | | - SPLUNK_APP_PACKAGE=output/Splunk_TA_UCCExample |
168 | | - export SPLUNK_APP_PACKAGE |
169 | | - export TEST_SET=tests/ui |
170 | | - export TEST_BROWSER="${{ matrix.browser }}" |
171 | | - export TEST_SUITE="-k ${{ matrix.test_suite }}" |
172 | | - export SAUCE_USERNAME="${{ secrets.SAUCE_USERNAME }}" |
173 | | - export SAUCE_PASSWORD="${{ secrets.SAUCE_PASSWORD }}" |
174 | | - export SAUCE_TUNNEL_ID="${{ secrets.SAUCE_TUNNEL_ID }}" |
175 | | - JOB_NAME="GithubActions::${GITHUB_REPOSITORY#splunk/}[${GITHUB_REF#refs/heads/}][${{ matrix.browser }}] #$(date +%s)" |
176 | | - export JOB_NAME |
177 | | - SAUCE_IDENTIFIER=$SAUCE_IDENTIFIER-$(cat /proc/sys/kernel/random/uuid) |
178 | | - export SAUCE_IDENTIFIER |
179 | | - echo "environment setup..." |
180 | | - echo "$SPLUNK_VERSION" |
181 | | - echo "$SPLUNK_APP_ID" |
182 | | - echo "$SPLUNK_APP_PACKAGE" |
183 | | - echo "$TEST_SET" |
184 | | - echo "$TEST_BROWSER" |
185 | | - echo "$TEST_SUITE" |
186 | | - echo "Testing..." |
187 | | - docker-compose -f docker-compose-ci.yml build |
188 | | - # Saucelab connection |
189 | | - docker-compose -f docker-compose-ci.yml up -d sauceconnect |
190 | | -
|
191 | | - # Start Splunk |
192 | | - docker-compose -f docker-compose-ci.yml up -d splunk |
193 | | - until docker-compose -f docker-compose-ci.yml logs splunk | grep "Ansible playbook complete" ; do sleep 1; done |
194 | | - # Normal Inspecting |
195 | | - docker-compose -f docker-compose-ci.yml logs sauceconnect |
196 | | - docker ps -a |
197 | | - # Run the tests |
198 | | - test_exit_code=0 |
199 | | - docker-compose -f docker-compose-ci.yml up --abort-on-container-exit test || test_exit_code=$? |
200 | | - # Collect Results |
201 | | - docker container create --name dummy \ |
202 | | - -v addon-factory-smartx-ui-test-library_results:/work/test-results \ |
203 | | - registry.access.redhat.com/ubi7/ubi |
204 | | - docker cp dummy:/work/test-results/test.xml test-results/ || true |
205 | | - docker cp dummy:/work/test-results/test.xml test-results/ || true |
206 | | - docker cp dummy:/work/assets test-results/assets || true |
207 | | - docker cp dummy:/work/test-results/report.html test-results/report.html || true |
208 | | - docker-compose -f docker-compose-ci.yml down || true |
209 | | - echo exit code "$test_exit_code" |
210 | | - exit "$test_exit_code" |
| 155 | + export PATH=$PATH:$CHROMEWEBDRIVER |
| 156 | + chromedriver --version |
| 157 | + export PATH=$PATH:$GECKOWEBDRIVER |
| 158 | + geckodriver --version |
| 159 | + - run: | |
| 160 | + ./run_splunk.sh ${{ matrix.splunk.version }} |
| 161 | + until curl -Lsk "https://localhost:8088/services/collector/health" &>/dev/null ; do echo -n "Waiting for HEC-" && sleep 5 ; done |
| 162 | + - run: poetry run pytest tests/ui -k "${{ matrix.test_suite }}" --headless --junitxml=test-results/junit.xml |
211 | 163 | - uses: actions/upload-artifact@v3 |
212 | 164 | if: always() |
213 | 165 | with: |
|
0 commit comments