diff --git a/.evergreen/orchestration/drivers_orchestration.py b/.evergreen/orchestration/drivers_orchestration.py index 938bcff59..9e97c96c2 100644 --- a/.evergreen/orchestration/drivers_orchestration.py +++ b/.evergreen/orchestration/drivers_orchestration.py @@ -178,6 +178,7 @@ def run(opts): expansion_yaml.unlink(missing_ok=True) expansion_sh = Path("mo-expansion.sh") expansion_sh.unlink(missing_ok=True) + uri_txt = DRIVERS_TOOLS / "uri.txt" # The evergreen directory to path. os.environ["PATH"] = f"{EVG_PATH}:{os.environ['PATH']}" @@ -298,6 +299,7 @@ def run(opts): # Handle the cluster uri. uri = resp.get("mongodb_auth_uri", resp["mongodb_uri"]) expansion_yaml.write_text(expansion_yaml.read_text() + f"\nMONGODB_URI: {uri}") + uri_txt.write_text(uri) LOGGER.info(f"Cluster URI: {uri}") # Write the results file. diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index eb74039ce..017c998f5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -8,6 +8,14 @@ on: branches: - "master" +concurrency: + group: tests-${{ github.ref }} + cancel-in-progress: true + +defaults: + run: + shell: bash -eux {0} + jobs: tests: name: "Tests" @@ -41,7 +49,7 @@ jobs: fetch-depth: 2 - id: setup-mongodb - name: "Test GitHub Action" + name: "Run GitHub Action" uses: ./ with: version: ${{ matrix.mongodb-version }} @@ -49,6 +57,17 @@ jobs: auth: ${{ matrix.auth }} ssl: ${{ matrix.ssl }} + - id: test-mongodb + name: "Test GitHub Action" + run: | + chmod +x mongodb/bin/mongosh + URI=$(cat uri.txt) + ARGS="" + if [ ${{ matrix.ssl }} == "ssl" ]; then + ARGS="--tls --tlsCertificateKeyFile $(pwd)/.evergreen/x509gen/client.pem --tlsCAFile $(pwd)/.evergreen/x509gen/ca.pem" + fi + mongodb/bin/mongosh $URI $ARGS --eval "db.runCommand({ ping: 1 })" + pre-commit: runs-on: ubuntu-latest steps: