|
69 | 69 | echo "combined-projects-matrix=$COMBINED_PROJECTS" >> $GITHUB_OUTPUT |
70 | 70 | echo $FRAMEWORK_TESTS |
71 | 71 | echo $COMBINED_PROJECTS |
| 72 | +
|
| 73 | +
|
72 | 74 | framework-tests: |
73 | 75 | needs:prepare-matrices |
74 | 76 | # Using matrices let create multiple jobs runs based on the combinations of the variables from matrices. |
@@ -157,6 +159,74 @@ jobs: |
157 | 159 | name:test_report ${{ matrix.project.PART_NAME }} |
158 | 160 | path:utbot-framework-test/build/reports/tests/test/* |
159 | 161 |
|
| 162 | + |
| 163 | +spring-tests: |
| 164 | +runs-on:ubuntu-20.04 |
| 165 | +container: |
| 166 | +image:unittestbot/java-env:java17-zulu-jdk-gradle7.6.1-kotlinc1.8.0 |
| 167 | +volumes: |
| 168 | + -"/home/runner/runners:/home/runner/runners" |
| 169 | + -"/tmp/filebeat:/tmp/filebeat" |
| 170 | +steps: |
| 171 | + -name:Print environment variables |
| 172 | +run:printenv |
| 173 | + |
| 174 | + -name:Checkout repository |
| 175 | +uses:actions/checkout@v3 |
| 176 | + -name:Check out ${{ github.event.inputs.commit_sha }} commit |
| 177 | +if:github.event.inputs.commit_sha != '' |
| 178 | +run:| |
| 179 | + git config --global --add safe.directory ${GITHUB_WORKSPACE} |
| 180 | + git fetch |
| 181 | + git checkout ${{ github.event.inputs.commit_sha }} |
| 182 | +
|
| 183 | + -name:Run monitoring |
| 184 | +continue-on-error:true |
| 185 | +run:| |
| 186 | + chmod +x ./scripts/project/monitoring.sh |
| 187 | + ./scripts/project/monitoring.sh "${PUSHGATEWAY_HOSTNAME}" "${{ secrets.PUSHGATEWAY_USER }}" "${{ secrets.PUSHGATEWAY_PASSWORD }}" |
| 188 | + echo "Please visit Grafana to check metrics: https://${PUSHGATEWAY_HOSTNAME}/d/rYdddlPWk/node-exporter-full?orgId=1&from=now-1h&to=now&var-service=github&var-instance=${GITHUB_RUN_ID}-${HOSTNAME}&refresh=1m" |
| 189 | + echo --- |
| 190 | + printf ${{ secrets.CA_CERT }} | base64 -d > ${{ env.FILEBEAT_DIR }}/ca.crt |
| 191 | + printf ${{ secrets.CLIENT_CRT }} | base64 -d > ${{ env.FILEBEAT_DIR }}/client.crt |
| 192 | + printf ${{ secrets.CLIENT_KEY }} | base64 -d > ${{ env.FILEBEAT_DIR }}/client.key |
| 193 | + chmod +x ./scripts/project/logging.sh |
| 194 | + ./scripts/project/logging.sh "${FILEBEAT_DIR}" "${{ secrets.ELK_HOST }}:5044" |
| 195 | + echo "Please visit ELK to check logs https://logs.utbot.org/app/discover#/ using the following search pattern: github.env.HOSTNAME:\"${HOSTNAME}\" and github.env.GITHUB_RUN_ID:\"${GITHUB_RUN_ID}\" and not github.log_level:\"INFO\"" |
| 196 | +
|
| 197 | + -uses:actions/cache@v3 |
| 198 | +with: |
| 199 | +path:/root/.gradle/caches |
| 200 | +key:${{ runner.os }}-gradle-spring-${{ hashFiles('./*.gradle*', './utbot-spring*/*.gradle*') }} |
| 201 | +restore-keys:${{ runner.os }}-gradle-spring |
| 202 | + |
| 203 | + -name:Run tests |
| 204 | +run:| |
| 205 | + cd utbot-spring-test |
| 206 | + gradle --no-daemon --build-cache --no-parallel -Dorg.gradle.jvmargs=-Xmx6g -Dkotlin.daemon.jvm.options=-Xmx4g :utbot-spring-test:test |
| 207 | +
|
| 208 | + -name:Upload logs |
| 209 | +if:${{ always() }} |
| 210 | +uses:actions/upload-artifact@v3 |
| 211 | +with: |
| 212 | +name:logs utbot-spring-test |
| 213 | +path:utbot-spring-test/logs/* |
| 214 | + -name:Upload UTBot temp directory content |
| 215 | +if:${{ always() }} |
| 216 | +uses:actions/upload-artifact@v3 |
| 217 | +with: |
| 218 | +name:utbot_temp utbot-spring-test |
| 219 | +path:| |
| 220 | + /tmp/UTBot/generated*/* |
| 221 | + /tmp/UTBot/utbot-instrumentedprocess-errors/* |
| 222 | + -name:Upload test report if tests have failed |
| 223 | +if:${{ failure() }} |
| 224 | +uses:actions/upload-artifact@v3 |
| 225 | +with: |
| 226 | +name:test_report utbot-spring-test |
| 227 | +path:utbot-spring-test/build/reports/tests/test/* |
| 228 | + |
| 229 | + |
160 | 230 | combined-projects: |
161 | 231 | # This job does not need to wait for 'prepare-tests-matrix' result. |
162 | 232 | # GitHub allocates runners portionally. Framework tests are time consuming. That's why we want to force them |
|