Skip to content

Commit ea7fbc8

Browse files
sschuberthheliocastro
authored andcommitted
refactor(github): Run functional tests against the snapshot Docker image
Instead of using Batect with the committed `Dockerfile-legacy`, use a GitHub action container based on the most recent Docker image published from the `main` branch to run functional tests. This should speed up the test run as the Docker image does not need to be built on every run. The downside is that `Dockerfile` changes and e.g. package manager changes depending on it cannot be performed in the same commit / PR as the image first needs to get published. Signed-off-by: Sebastian Schuberth <[email protected]>
1 parent 46de195 commit ea7fbc8

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

.github/workflows/build-and-test.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,9 @@ jobs:
139139
flags: funTest-non-docker
140140
funTest-docker:
141141
runs-on: ubuntu-22.04
142+
container:
143+
image: ghcr.io/oss-review-toolkit/ort:snapshot
144+
options: --user 1001
142145
steps:
143146
- name: Checkout Repository
144147
uses: actions/checkout@v4
@@ -149,18 +152,11 @@ jobs:
149152
with:
150153
distribution: temurin
151154
java-version: 17
152-
- name: Setup Gradle
155+
- name: Run functional tests that do require external tools
153156
uses: gradle/gradle-build-action@v2
154157
with:
155158
gradle-home-cache-cleanup: true
156-
- name: Run functional tests that do require external tools
157-
run: |
158-
echo "Running as $(id)."
159-
BATECT_QUIET_DOWNLOAD=true ./batect --enable-buildkit \
160-
--config-var docker_build_user_id=1001 \
161-
--config-var gradle_build_scan=true \
162-
--config-var gradle_console=plain \
163-
runFunTest
159+
arguments: --scan -Ptests.include=org.ossreviewtoolkit.plugins.packagemanagers.* funTest jacocoFunTestReport
164160
- name: Upload code coverage data
165161
uses: codecov/codecov-action@v3
166162
with:

0 commit comments

Comments
 (0)