Skip to content

Commit 3c745d9

Browse files
committed
Add ./example-module
HIBERNATE-52
1 parent 6736fb2 commit 3c745d9

26 files changed

+1254
-10
lines changed

.evergreen/config.yml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,21 @@ tasks:
137137
args:
138138
- run-integration-tests.sh
139139

140+
- name: run-smoke-tests
141+
tags:
142+
- pr
143+
commands:
144+
- func: bootstrap-mongo-orchestration
145+
- command: subprocess.exec
146+
type: test
147+
params:
148+
working_dir: src
149+
binary: bash
150+
add_to_path:
151+
- .evergreen
152+
args:
153+
- run-smoke-tests.sh
154+
140155
- name: publish-snapshot
141156
depends_on:
142157
- variant: static-checks
@@ -227,9 +242,16 @@ buildvariants:
227242
tasks:
228243
- name: run-unit-tests
229244

230-
- matrix_name: mongo-hibernate
231-
matrix_spec: { mongo-version: "*", topology: "*", os: "*" }
245+
- matrix_name: run-smoke-tests
246+
matrix_spec: { mongo-version: "8.0", topology: replicaset, os: linux }
247+
display_name: "Smoke Tests"
248+
tags:
249+
- pr
250+
tasks:
251+
- name: run-smoke-tests
232252

253+
- matrix_name: run-integration-tests
254+
matrix_spec: { mongo-version: "*", topology: "*", os: "*" }
233255
display_name: "${mongo-version} ${topology} ${os}"
234256
tags:
235257
- pr

.evergreen/fetch-drivers-tools.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ if [[ -z "$DRIVERS_TOOLS" ]]; then
77
exit 1
88
fi
99

10-
rm -rf $DRIVERS_TOOLS
11-
git clone https://github.com/mongodb-labs/drivers-evergreen-tools.git $DRIVERS_TOOLS
10+
rm -rf "$DRIVERS_TOOLS"
11+
git clone https://github.com/mongodb-labs/drivers-evergreen-tools.git "$DRIVERS_TOOLS"

.evergreen/publish.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,4 @@ fi
2525
SYSTEM_PROPERTIES="-Dorg.gradle.internal.publish.checksums.insecure=true"
2626

2727
./gradlew -version
28-
./gradlew ${SYSTEM_PROPERTIES} --stacktrace --info ${TASK}
28+
./gradlew ${SYSTEM_PROPERTIES} --stacktrace --info "${TASK}"

.evergreen/run-integration-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ echo "MongoDB version: ${MONGODB_VERSION}; topology: ${TOPOLOGY}"
1515

1616
./gradlew -version
1717

18-
./gradlew -PjavaVersion=${JAVA_VERSION} --stacktrace --info --continue clean integrationTest
18+
./gradlew -PjavaVersion="${JAVA_VERSION}" --stacktrace --info --continue clean integrationTest

.evergreen/run-smoke-tests.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env bash
2+
3+
set -o xtrace # Write all commands first to stderr
4+
set -o errexit # Exit the script with error if any of the commands fail
5+
6+
############################################
7+
# Main Program #
8+
############################################
9+
10+
source java-config.sh
11+
12+
echo "mongo-hibernate: running smoke tests ..."
13+
14+
echo "MongoDB version: ${MONGODB_VERSION}; topology: ${TOPOLOGY}"
15+
16+
./gradlew -version
17+
18+
./gradlew -PjavaVersion="${JAVA_VERSION}" publishToMavenLocal \
19+
&& ./example-module/mvnw clean verify -f ./example-module/pom.xml \
20+
-DjavaVersion="${JAVA_VERSION}" \
21+
-DprojectVersion="$(./gradlew -q printProjectVersion)"

.evergreen/run-unit-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ echo "mongo-hibernate: running unit tests ..."
1313

1414
./gradlew -version
1515

16-
./gradlew -PjavaVersion=${JAVA_VERSION} --stacktrace --info --continue clean test
16+
./gradlew -PjavaVersion="${JAVA_VERSION}" --stacktrace --info --continue clean test

.gitattributes

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
# These are Windows script files and should use crlf
88
*.bat text eol=crlf
9+
*.cmd text eol=crlf
910

1011
# Binary files should be left untouched
1112
*.jar binary
12-

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
/bin/
2525

2626
# Intellij IDEA
27-
/.idea/
27+
.idea/
2828
/*.ipr
2929
/*.iws
3030
/*.iml
@@ -34,4 +34,5 @@
3434
# Gradle
3535
.gradle/
3636
.kotlin/
37-
build/
37+
build/
38+
target/

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,23 @@ Use ["Extension for Hibernate ORM" at jira.mongodb.org](https://jira.mongodb.org
5454

5555
Use ["Drivers & Frameworks"/"Frameworks (e.g. Django, Hibernate, EFCore)" at feedback.mongodb.com" at feedback.mongodb.com](https://feedback.mongodb.com/?category=7548141831345841376).
5656

57+
### Examples
58+
59+
[Maven](https://maven.apache.org/) is used as a build tool.
60+
61+
The example applications are located in [`./example-module`](example-module).
62+
They require a MongoDB deployment accessible at `localhost:27017`.
63+
64+
#### Build and Run from Source
65+
66+
```console
67+
source ./.evergreen/java-config.sh \
68+
&& ./gradlew -PjavaVersion=${JAVA_VERSION} clean publishToMavenLocal \
69+
&& ./example-module/mvnw clean verify -f ./example-module/pom.xml \
70+
-DjavaVersion="${JAVA_VERSION}" \
71+
-DprojectVersion="$(./gradlew -q printProjectVersion)"
72+
```
73+
5774
## Contributor Documentation
5875

5976
[Gradle](https://gradle.org/) is used as a build tool.

build.gradle.kts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,3 +354,6 @@ tasks.register("publishArchives") {
354354
dependsOn(tasks.named("publishToSonatype"))
355355
}
356356
}
357+
358+
// `./gradlew -q printProjectVersion`
359+
tasks.register("printProjectVersion") { doLast { logger.quiet(project.version.toString()) } }

0 commit comments

Comments
 (0)