Skip to content

Commit e5d8cad

Browse files
temp 2
1 parent aeda36b commit e5d8cad

File tree

3 files changed

+103
-47
lines changed

3 files changed

+103
-47
lines changed

.github/scripts/run-kms-servers.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
set -o errexit # Exit the script with error if any of the commands fail
3+
4+
cd ${DRIVERS_TOOLS}/.evergreen/csfle
5+
. ./prepare-kmsvenv.sh
6+
7+
echo "$PYTHON_EXEC"
8+
9+
$PYTHON_EXEC -u kms_http_server.py --ca_file ../x509gen/ca.pem --cert_file ../x509gen/expired.pem --port 8000 &
10+
$PYTHON_EXEC -u kms_http_server.py --ca_file ../x509gen/ca.pem --cert_file ../x509gen/wrong-host.pem --port 8001 &
11+
$PYTHON_EXEC -u kms_http_server.py --ca_file ../x509gen/ca.pem --cert_file ../x509gen/server.pem --port 8002 --require_client_cert &
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#! /usr/bin/env bash
2+
3+
# This is a thin wrapper around drivers-tools run orchestration meant to print each of the configuration settings we make use of
4+
# Additionally it ensures the downloaded binaries are in the PATH for the script to find (namely, the legacy shell for server set up)
5+
6+
export MONGODB_VERSION=${VERSION}
7+
echo "MONGODB_VERSION=${VERSION}"
8+
9+
export TOPOLOGY=${TOPOLOGY}
10+
echo "TOPOLOGY=${TOPOLOGY}"
11+
12+
export AUTH=${AUTH}
13+
echo "AUTH=${AUTH}"
14+
15+
export SSL=${SSL}
16+
echo "SSL=${SSL}"
17+
18+
export ORCHESTRATION_FILE=${ORCHESTRATION_FILE}
19+
echo "ORCHESTRATION_FILE=${ORCHESTRATION_FILE}"
20+
21+
export REQUIRE_API_VERSION=${REQUIRE_API_VERSION}
22+
echo "REQUIRE_API_VERSION=${REQUIRE_API_VERSION}"
23+
24+
export LOAD_BALANCER=${LOAD_BALANCER}
25+
echo "LOAD_BALANCER=${LOAD_BALANCER}"
26+
27+
export COMPRESSOR=${COMPRESSOR}
28+
echo "COMPRESSOR=${COMPRESSOR}"
29+
30+
export PATH="$MONGODB_BINARIES:$PATH"
31+
echo "MONGODB_BINARIES=${MONGODB_BINARIES}"
32+
33+
export SKIP_LEGACY_SHELL="true"
34+
echo "SKIP_LEGACY_SHELL=${SKIP_LEGACY_SHELL}"
35+
36+
bash "${DRIVERS_TOOLS}/.evergreen/run-orchestration.sh"

.github/workflows/encryption-tests.yml

Lines changed: 56 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ permissions:
1111
name: encryption-tests
1212

1313
jobs:
14-
ssdlc:
14+
set-up:
1515
permissions:
1616
# required for all workflows
1717
security-events: write
@@ -24,52 +24,61 @@ jobs:
2424

2525
- name: Set-up cluster
2626
- shell: bash
27-
2827

29-
30-
31-
- name: Run tests
32-
uses: mongodb-labs/drivers-github-tools/node/get_version_info@v2
33-
with:
34-
npm_package_name: mongodb
35-
36-
- name: actions/compress_sign_and_upload
37-
uses: mongodb-labs/drivers-github-tools/node/sign_node_package@v2
38-
with:
39-
aws_role_arn: ${{ secrets.AWS_ROLE_ARN }}
40-
aws_region_name: us-east-1
41-
aws_secret_id: ${{ secrets.AWS_SECRET_ID }}
42-
npm_package_name: mongodb
43-
dry_run: ${{ needs.release_please.outputs.release_created == '' }}
44-
45-
- name: Copy sbom file to release assets
46-
shell: bash
47-
if: ${{ '' == '' }}
48-
run: cp sbom.json ${{ env.S3_ASSETS }}/sbom.json
49-
50-
# only used for mongodb-client-encryption
51-
- name: Augment SBOM and copy to release assets
52-
if: ${{ '' != '' }}
53-
uses: mongodb-labs/drivers-github-tools/sbom@v2
54-
with:
55-
silk_asset_group: ''
56-
sbom_file_name: sbom.json
57-
58-
- name: Generate authorized pub report
59-
uses: mongodb-labs/drivers-github-tools/full-report@v2
28+
run-tests:
29+
needs:
30+
- set-up
31+
runs-on: ${{ matrix.os }}
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
node: [20]
36+
os: [ubuntu-latest]
37+
mongodb: [8.0.0]
38+
#clone drivers-evergreen-tools (will delete itself once the run is over)
39+
git clone --depth=1 https://github.com/mongodb-labs/drivers-evergreen-tools.git /data/mci/ead9f9a67ef900991e09bd9589dfee0e/drivers-tools
40+
#set path
41+
#calling run orchestration sets up a server on your computer
42+
# it outputs relevants uri in expansions.yml
43+
# put uri into an environment variable
44+
- name: set-up-orchestration
45+
- command: subprocess.exec
46+
params:
47+
binary: bash
48+
add_expansions_to_env: true
49+
env:
50+
# The following is the settings for how we want to launch mongodb
51+
MONGODB_VERSION: ${VERSION}
52+
TOPOLOGY: ${TOPOLOGY}
53+
AUTH: ${AUTH}
54+
SSL: ${SSL}
55+
ORCHESTRATION_FILE: ${ORCHESTRATION_FILE}
56+
REQUIRE_API_VERSION: ${REQUIRE_API_VERSION}
57+
LOAD_BALANCER: ${LOAD_BALANCER}
58+
COMPRESSOR: ${COMPRESSOR}
59+
# These are paths necessary for launching mongodb
60+
DRIVERS_TOOLS: ${DRIVERS_TOOLS}
61+
MONGODB_BINARIES: ${MONGODB_BINARIES}
62+
args:
63+
- .github/scripts/run-orchestration.sh
64+
name: Encryption tests
65+
env:
66+
FORCE_COLOR: true
67+
steps:
68+
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
69+
- name: Setup node
70+
uses: actions/setup-node@0a44ba7841725637a19e28fa30b79a866c81b0a6 # v4.0.4
6071
with:
61-
release_version: ${{ env.package_version }}
62-
product_name: mongodb
63-
sarif_report_target_ref: 'main'
64-
third_party_dependency_tool: n/a
65-
dist_filenames: artifacts/*
66-
token: ${{ github.token }}
67-
sbom_file_name: sbom.json
68-
evergreen_project: mongo-node-driver-next
69-
evergreen_commit: ${{ env.commit }}
70-
71-
- uses: mongodb-labs/drivers-github-tools/upload-s3-assets@v2
72+
node-version: latest
73+
- name: Load MongoDB binary cache
74+
id: cache-mongodb-binaries
75+
uses: actions/cache@v4
7276
with:
73-
version: ${{ env.package_version }}
74-
product_name: mongodb
75-
dry_run: ${{ needs.release_please.outputs.release_created == '' }}
77+
path: ~/.cache/mongodb-binaries
78+
key: ${{ matrix.os }}-${{ matrix.mongodb }}
79+
- name: Install Dependencies
80+
run: npm install
81+
- name: Install drivers-evergreen-tools
82+
83+
- name: Test
84+
run: mocha --exit ./test/encryption/*.test.js

0 commit comments

Comments
 (0)