Skip to content

Commit af54143

Browse files
authored
DRIVERS-3032 Write uri.txt (#584)
1 parent d5f54a6 commit af54143

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

.evergreen/orchestration/drivers_orchestration.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ def run(opts):
178178
expansion_yaml.unlink(missing_ok=True)
179179
expansion_sh = Path("mo-expansion.sh")
180180
expansion_sh.unlink(missing_ok=True)
181+
uri_txt = DRIVERS_TOOLS / "uri.txt"
181182

182183
# The evergreen directory to path.
183184
os.environ["PATH"] = f"{EVG_PATH}:{os.environ['PATH']}"
@@ -298,6 +299,7 @@ def run(opts):
298299
# Handle the cluster uri.
299300
uri = resp.get("mongodb_auth_uri", resp["mongodb_uri"])
300301
expansion_yaml.write_text(expansion_yaml.read_text() + f"\nMONGODB_URI: {uri}")
302+
uri_txt.write_text(uri)
301303
LOGGER.info(f"Cluster URI: {uri}")
302304

303305
# Write the results file.

.github/workflows/tests.yml

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ on:
88
branches:
99
- "master"
1010

11+
concurrency:
12+
group: tests-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
defaults:
16+
run:
17+
shell: bash -eux {0}
18+
1119
jobs:
1220
tests:
1321
name: "Tests"
@@ -41,14 +49,25 @@ jobs:
4149
fetch-depth: 2
4250

4351
- id: setup-mongodb
44-
name: "Test GitHub Action"
52+
name: "Run GitHub Action"
4553
uses: ./
4654
with:
4755
version: ${{ matrix.mongodb-version }}
4856
topology: ${{ matrix.topology }}
4957
auth: ${{ matrix.auth }}
5058
ssl: ${{ matrix.ssl }}
5159

60+
- id: test-mongodb
61+
name: "Test GitHub Action"
62+
run: |
63+
chmod +x mongodb/bin/mongosh
64+
URI=$(cat uri.txt)
65+
ARGS=""
66+
if [ ${{ matrix.ssl }} == "ssl" ]; then
67+
ARGS="--tls --tlsCertificateKeyFile $(pwd)/.evergreen/x509gen/client.pem --tlsCAFile $(pwd)/.evergreen/x509gen/ca.pem"
68+
fi
69+
mongodb/bin/mongosh $URI $ARGS --eval "db.runCommand({ ping: 1 })"
70+
5271
pre-commit:
5372
runs-on: ubuntu-latest
5473
steps:

0 commit comments

Comments
 (0)