Skip to content

Commit 592b38f

Browse files
committed
Run the joint workflow against one MongoDB
The build_grails job served the test-example applications from a mongo:8 service container on 27017, but named no version to the build, so the specifications that bring their own server took the default in AbstractMongoGrailsExtension instead: testcontainers started mongo:7.0.19 and the embedded server started V7_0. One job was testing three MongoDB releases at once, and which one a failure belonged to was not apparent from the job. The service container is gone rather than aligned, because nothing needs it. StartMongoGrailsIntegrationExtension probes localhost:27017 and starts a container of its own when nothing answers, so the service was only ever an optimisation; mongodbFunctional in gradle.yml runs the whole MongoDB suite with `check -PonlyMongodbTests` and no service container, and is a required upstream of publish. What is left brings its own server: a container for most specifications, an embedded replica set for the four that need transactions. -PmongodbContainerVersion=8.0 keeps those two on one release. This workflow validates Grails against a Groovy snapshot rather than against a range of MongoDB releases -- that coverage is the mongodb-version matrix in gradle.yml, which runs 7.0 and 8.0 -- so the latest supported line is the one to run here.
1 parent 49cbe1d commit 592b38f

1 file changed

Lines changed: 8 additions & 14 deletions

File tree

.github/workflows/groovy-joint-workflow.yml

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -115,16 +115,6 @@ jobs:
115115
- shard_index: 2
116116
gradle_task: testShard
117117
runs-on: ubuntu-latest
118-
services:
119-
mongodb:
120-
image: mongo:8
121-
ports:
122-
- 27017:27017
123-
options: >-
124-
--health-cmd "mongosh --eval 'db.adminCommand(\"ping\")'"
125-
--health-interval 10s
126-
--health-timeout 5s
127-
--health-retries 5
128118
steps:
129119
- name: "⚙️ Maximize build space"
130120
run: |
@@ -161,11 +151,9 @@ jobs:
161151
uses: actions/cache@v4
162152
with:
163153
# Separate from the dependency jars, for the reasons given on the same step in
164-
# gradle.yml. This job names no version, so it gets the one
165-
# AbstractMongoGrailsExtension.DEFAULT_MONGO_VERSION names; a change there costs one
166-
# download, not a wrong binary, since this key has no other reader.
154+
# gradle.yml. The version is the one -PmongodbContainerVersion asks for below.
167155
path: ~/.embedmongo
168-
key: embedmongo-${{ runner.os }}-7.0
156+
key: embedmongo-${{ runner.os }}-8.0
169157
- name: "🐘 Setup Gradle"
170158
uses: gradle/actions/setup-gradle@50e97c2cd7a37755bbfafc9c5b7cafaece252f6e # v6.1.0
171159
with:
@@ -187,6 +175,11 @@ jobs:
187175
# That island intentionally pins Groovy 5 / Spock 2.4-groovy-5.0 via grails-micronaut-bom,
188176
# which is incompatible with the Groovy 4.x snapshot this job swaps in above.
189177
# See https://github.com/apache/grails-core/issues/15613.
178+
#
179+
# -PmongodbContainerVersion names the MongoDB the specifications bring themselves: a
180+
# container for most of them, an embedded server for the ones that need a replica set. It
181+
# keeps those two on the same release. This workflow validates Grails against a Groovy
182+
# snapshot rather than against a range of MongoDB releases, which is gradle.yml's matrix.
190183
run: >
191184
./gradlew ${{ matrix.gradle_task }}
192185
--continue
@@ -197,6 +190,7 @@ jobs:
197190
-PmaxTestParallel=3
198191
-PtestShardCount=3
199192
-PtestShardIndex=${{ matrix.shard_index }}
193+
-PmongodbContainerVersion=8.0
200194
env:
201195
GRAILS_INCLUDE_MAVEN_LOCAL: true
202196
- name: "🗄️ Save dependency jar cache"

0 commit comments

Comments
 (0)