Skip to content

Commit abe43e6

Browse files
alisevychbissquit
andauthored
Add spring tests job (#2388)
* Add spring tests job --------- Co-authored-by: Alena Lisevych <alena.lisevych@gmail.com> Co-authored-by: Egor Vasilyev <e.s.vasilyev@mail.ru>
1 parent f41d891 commit abe43e6

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed

.github/workflows/build-and-run-tests-from-branch.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ jobs:
6969
echo "combined-projects-matrix=$COMBINED_PROJECTS" >> $GITHUB_OUTPUT
7070
echo $FRAMEWORK_TESTS
7171
echo $COMBINED_PROJECTS
72+
73+
7274
framework-tests:
7375
needs: prepare-matrices
7476
# Using matrices let create multiple jobs runs based on the combinations of the variables from matrices.
@@ -157,6 +159,74 @@ jobs:
157159
name: test_report ${{ matrix.project.PART_NAME }}
158160
path: utbot-framework-test/build/reports/tests/test/*
159161

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+
160230
combined-projects:
161231
# This job does not need to wait for 'prepare-tests-matrix' result.
162232
# GitHub allocates runners portionally. Framework tests are time consuming. That's why we want to force them

0 commit comments

Comments
 (0)