Skip to content

Commit c3936f1

Browse files
asd;fasdflkjasd;f
1 parent a989c65 commit c3936f1

File tree

8 files changed

+157
-16
lines changed

8 files changed

+157
-16
lines changed

.evergreen/config.in.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,19 @@ functions:
734734
args:
735735
- ${PROJECT_DIRECTORY}/.evergreen/install-mongodb-client-encryption.sh
736736

737+
"build docker alpine image":
738+
- command: subprocess.exec
739+
type: setup
740+
params:
741+
working_dir: "src"
742+
env:
743+
INSTALL_DIR: mongodb-client-encryption
744+
PROJECT_DIRECTORY: ${PROJECT_DIRECTORY}
745+
DRIVERS_TOOLS: ${DRIVERS_TOOLS}
746+
binary: bash
747+
args:
748+
- etc/docker.sh
749+
737750
tasks:
738751
- name: 'test-atlas-data-lake'
739752
tags: ["datalake", "mongohouse"]
@@ -994,7 +1007,6 @@ tasks:
9941007
add_expansions_to_env: true
9951008
args:
9961009
- .evergreen/run-search-index-management-tests.sh
997-
9981010
task_groups:
9991011
- name: serverless_task_group
10001012
setup_group_can_fail_task: true

.evergreen/config.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -657,6 +657,18 @@ functions:
657657
binary: bash
658658
args:
659659
- ${PROJECT_DIRECTORY}/.evergreen/install-mongodb-client-encryption.sh
660+
build docker alpine image:
661+
- command: subprocess.exec
662+
type: setup
663+
params:
664+
working_dir: src
665+
env:
666+
INSTALL_DIR: mongodb-client-encryption
667+
PROJECT_DIRECTORY: ${PROJECT_DIRECTORY}
668+
DRIVERS_TOOLS: ${DRIVERS_TOOLS}
669+
binary: bash
670+
args:
671+
- etc/docker.sh
660672
tasks:
661673
- name: test-atlas-data-lake
662674
tags:
@@ -1627,6 +1639,22 @@ tasks:
16271639
- func: install dependencies
16281640
- func: bootstrap mongo-orchestration
16291641
- func: run-compression-tests
1642+
- name: test-alpine-fle
1643+
tags:
1644+
- alpine-fle
1645+
commands:
1646+
- command: expansions.update
1647+
type: setup
1648+
params:
1649+
updates:
1650+
- {key: VERSION, value: latest}
1651+
- {key: TOPOLOGY, value: replica_set}
1652+
- {key: AUTH, value: auth}
1653+
- {key: CLIENT_ENCRYPTION, value: 'true'}
1654+
- {key: TEST_CSFLE, value: 'true'}
1655+
- func: install dependencies
1656+
- func: bootstrap mongo-orchestration
1657+
- func: build docker alpine image
16301658
- name: test-tls-support-latest
16311659
tags:
16321660
- tls-support
@@ -4224,6 +4252,7 @@ buildvariants:
42244252
- test-snappy-compression
42254253
- test-zstd-1.x-compression
42264254
- test-zstd-2.x-compression
4255+
- test-alpine-fle
42274256
- test-tls-support-latest
42284257
- test-tls-support-8.0
42294258
- test-tls-support-7.0
@@ -4284,6 +4313,7 @@ buildvariants:
42844313
- test-snappy-compression
42854314
- test-zstd-1.x-compression
42864315
- test-zstd-2.x-compression
4316+
- test-alpine-fle
42874317
- test-tls-support-latest
42884318
- test-tls-support-8.0
42894319
- test-tls-support-7.0
@@ -4344,6 +4374,7 @@ buildvariants:
43444374
- test-snappy-compression
43454375
- test-zstd-1.x-compression
43464376
- test-zstd-2.x-compression
4377+
- test-alpine-fle
43474378
- test-tls-support-latest
43484379
- test-tls-support-8.0
43494380
- test-tls-support-7.0
@@ -4404,6 +4435,7 @@ buildvariants:
44044435
- test-snappy-compression
44054436
- test-zstd-1.x-compression
44064437
- test-zstd-2.x-compression
4438+
- test-alpine-fle
44074439
- test-tls-support-latest
44084440
- test-tls-support-8.0
44094441
- test-tls-support-7.0
@@ -4461,6 +4493,7 @@ buildvariants:
44614493
- test-snappy-compression
44624494
- test-zstd-1.x-compression
44634495
- test-zstd-2.x-compression
4496+
- test-alpine-fle
44644497
- test-tls-support-latest
44654498
- test-tls-support-8.0
44664499
- test-tls-support-7.0
@@ -4511,6 +4544,7 @@ buildvariants:
45114544
- test-snappy-compression
45124545
- test-zstd-1.x-compression
45134546
- test-zstd-2.x-compression
4547+
- test-alpine-fle
45144548
- test-tls-support-latest
45154549
- test-tls-support-8.0
45164550
- test-tls-support-7.0
@@ -4560,6 +4594,7 @@ buildvariants:
45604594
- test-snappy-compression
45614595
- test-zstd-1.x-compression
45624596
- test-zstd-2.x-compression
4597+
- test-alpine-fle
45634598
- test-tls-support-latest
45644599
- test-tls-support-8.0
45654600
- test-tls-support-7.0
@@ -4609,6 +4644,7 @@ buildvariants:
46094644
- test-snappy-compression
46104645
- test-zstd-1.x-compression
46114646
- test-zstd-2.x-compression
4647+
- test-alpine-fle
46124648
- test-tls-support-latest
46134649
- test-tls-support-8.0
46144650
- test-tls-support-7.0
@@ -4658,6 +4694,7 @@ buildvariants:
46584694
- test-snappy-compression
46594695
- test-zstd-1.x-compression
46604696
- test-zstd-2.x-compression
4697+
- test-alpine-fle
46614698
- test-tls-support-latest
46624699
- test-tls-support-8.0
46634700
- test-tls-support-7.0
@@ -4912,3 +4949,8 @@ buildvariants:
49124949
run_on: rhel80-large
49134950
tasks:
49144951
- .resource-management
4952+
- name: alpine FLE test
4953+
display_name: alpine FLE test
4954+
run_on: ubuntu2204-large
4955+
tasks:
4956+
- .alpine-fle

.evergreen/generate_evergreen_tasks.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,23 @@ TASKS.push({
276276
]
277277
});
278278

279+
TASKS.push({
280+
name: `test-alpine-fle`,
281+
tags: ['alpine-fle'],
282+
commands: [
283+
updateExpansions({
284+
VERSION: 'latest',
285+
TOPOLOGY: 'replica_set',
286+
AUTH: 'auth',
287+
CLIENT_ENCRYPTION: 'true',
288+
TEST_CSFLE: 'true'
289+
}),
290+
{ func: 'install dependencies' },
291+
{ func: 'bootstrap mongo-orchestration' },
292+
{ func: 'build docker alpine image' }
293+
]
294+
});
295+
279296
const AWS_LAMBDA_HANDLER_TASKS = [];
280297
// Add task for testing lambda example without aws auth.
281298
AWS_LAMBDA_HANDLER_TASKS.push({
@@ -864,6 +881,13 @@ BUILD_VARIANTS.push({
864881
tasks: ['.resource-management']
865882
});
866883

884+
BUILD_VARIANTS.push({
885+
name: 'alpine FLE test',
886+
display_name: 'alpine FLE test',
887+
run_on: UBUNTU_22_OS,
888+
tasks: ['.alpine-fle']
889+
});
890+
867891
// TODO(NODE-4897): Debug socks5 tests on node latest
868892
for (const variant of BUILD_VARIANTS.filter(
869893
variant => variant.expansions && ['latest'].includes(variant.expansions.NODE_LTS_VERSION)

etc/docker.sh

Lines changed: 74 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,83 @@ NODE_VERSION=20.0.0
1313
SCRIPT_DIR=$(dirname ${BASH_SOURCE:-$0})
1414
PROJECT_DIR=$SCRIPT_DIR/..
1515

16+
# set -o xtrace
17+
18+
build_and_test_musl() {
19+
docker buildx create --name builder --bootstrap --use
20+
21+
BASE_TAG=$LINUX_ARCH-alpine-base-node-$NODE_VERSION
22+
# docker --debug buildx build --progress=plain \
23+
# --platform linux/$LINUX_ARCH --output=type=oci,dest=alpine-lib-base \
24+
# --build-arg="ARCH=$LINUX_ARCH" \
25+
# --build-arg="NODE_VERSION=$NODE_VERSION" \
26+
# --build-arg="RUN_TEST=true" \
27+
# -f ./.github/docker/Dockerfile.musl -t $BASE_TAG \
28+
# .
29+
30+
# cat alpine-lib-base | docker load
31+
32+
# LIBMONGOCRYPT_TAG=$LINUX_ARCH-alpine-libmongocrypt-node-$NODE_VERSION
33+
# docker --debug buildx build --progress=plain --pull=false \
34+
# --output=type=oci,dest=alpine-libmongocrypt \
35+
# --platform linux/$LINUX_ARCH \
36+
# --build-arg="ARCH=$LINUX_ARCH" \
37+
# --build-arg="NODE_VERSION=$NODE_VERSION" \
38+
# -f ./.github/docker/AddLibmongocrypt.dockerfile -t $LIBMONGOCRYPT_TAG \
39+
# .
40+
41+
# cat alpine-libmongocrypt | docker load
42+
43+
LIBMONGOCRYPT_TAG=$LINUX_ARCH-alpine-prebuilds-node-$NODE_VERSION
44+
# docker --debug buildx build --progress=plain --pull=false \
45+
# --load \
46+
# --platform linux/$LINUX_ARCH \
47+
# --build-arg="ARCH=$LINUX_ARCH" \
48+
# --build-arg="NODE_VERSION=$NODE_VERSION" \
49+
# -f ./.github/docker/Prebuilds.dockerfile -t $LIBMONGOCRYPT_TAG \
50+
# .
51+
52+
docker --debug run $LIBMONGOCRYPT_TAG bash -c "npm test"
53+
}
54+
55+
build_and_test_glibc() {
56+
docker buildx create --name builder --bootstrap --use
57+
58+
UBUNTU_VERSION=$(node --print 'Number(process.argv[1].split(`.`).at(0)) > 16 ? `noble` : `bionic`' $NODE_VERSION)
59+
NODE_ARCH=$(node -p 'process.argv[1] === `amd64` && `x64` || process.argv[1]' $LINUX_ARCH)
60+
echo $UBUNTU_VERSION
61+
docker buildx build --progress=plain --no-cache \
62+
--platform linux/$LINUX_ARCH \
63+
--build-arg="NODE_ARCH=$NODE_ARCH" \
64+
--build-arg="NODE_VERSION=$NODE_VERSION" \
65+
--build-arg="UBUNTU_VERSION=$UBUNTU_VERSION" \
66+
--build-arg="RUN_TEST=true" \
67+
--output type=local,dest=./prebuilds,platform-split=false \
68+
-f ./.github/docker/Dockerfile.glibc \
69+
$PROJECT_DIR
70+
}
71+
72+
# build_and_test_musl
73+
# build_and_test_glibc
74+
75+
docker buildx create --name builder --bootstrap --use
76+
1677
# bash $DRIVERS_TOOLS/.evergreen/secrets_handling/setup-secrets.sh drivers/csfle
1778

1879
BASE_TAG=$LINUX_ARCH-alpine-base-node-$NODE_VERSION
80+
docker --debug buildx build --load --progress=plain \
81+
--platform linux/$LINUX_ARCH \
82+
--build-arg="ARCH=$LINUX_ARCH" \
83+
--build-arg="NODE_VERSION=$NODE_VERSION" \
84+
--build-arg="RUN_TEST=true" \
85+
-f ./.evergreen/docker/Dockerfile.musl -t test-tag-1 \
86+
.
1987

20-
# podman build --load --progress=plain \
21-
# --platform linux/$LINUX_ARCH \
22-
# --build-arg="ARCH=$LINUX_ARCH" \
23-
# --build-arg="NODE_VERSION=$NODE_VERSION" \
24-
# --build-arg="RUN_TEST=true" \
25-
# -f ./.evergreen/docker/Dockerfile.musl -t test-tag-1 \
26-
# .
27-
28-
MONGODB_URI=$(echo $MONGODB_URI | sed 's/127.0.0.1/host.containers.internal/g')
88+
# MONGODB_URI=$(echo $MONGODB_URI | sed 's/127.0.0.1/host.docker.internal/g')
2989

30-
set -o xtrace
31-
# echo "launching process"
90+
# set -o xtrace
91+
# # echo "launching process"
3292

33-
# docker --debug run --platform linux/$LINUX_ARCH -e MONGODB_URI=${MONGODB_URI} --entrypoint bash test-tag-1 '.evergreen/run-alpine-fle-tests.sh'
34-
podman run --platform linux/arm64v8/v8 -e MONGODB_URI=$MONGODB_URI --entrypoint bash -i -t localhost/test-tag-1:latest
93+
# # docker --debug run --platform linux/$LINUX_ARCH -e MONGODB_URI=${MONGODB_URI} --entrypoint bash test-tag-1 '.evergreen/run-alpine-fle-tests.sh'
94+
# docker --debug run --platform linux/$LINUX_ARCH -e MONGODB_URI=$MONGODB_URI \
95+
# --entrypoint bash -ti test-tag-1

test/integration/client-side-encryption/client_side_encryption.spec.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ const isServerless = !!process.env.SERVERLESS;
6262

6363
const filter = new ClientSideEncryptionFilter();
6464

65-
describe.only('Client Side Encryption (Legacy)', function () {
65+
describe('Client Side Encryption (Legacy)', function () {
6666
const testContext = new TestRunnerContext({ requiresCSFLE: true });
6767
const testSuites = gatherTestSuites(
6868
path.join(__dirname, '../../spec/client-side-encryption/tests/legacy'),

test/integration/client-side-operations-timeout/client_side_operations_timeout.spec.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const skippedTests = {
2121
'timeoutMS is refreshed for getMore if maxAwaitTimeMS is set': 'TODO(DRIVERS-3018)'
2222
};
2323

24-
describe('CSOT spec tests', function () {
24+
describe.only('CSOT spec tests', function () {
2525
const specs = loadSpecTests('client-side-operations-timeout');
2626
for (const spec of specs) {
2727
for (const test of spec.tests) {

test/tools/runner/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ export class TestConfiguration {
297297

298298
const connectionString = url.format(urlOptions);
299299

300+
console.error({ connectionString })
300301
return new MongoClient(connectionString, serverOptions);
301302
}
302303

test/tools/unified-spec-runner/entities.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -578,6 +578,7 @@ export class EntitiesMap<E = Entity> extends Map<string, E> {
578578
} else {
579579
uri = makeConnectionString(config.url({ useMultipleMongoses }), entity.client.uriOptions);
580580
}
581+
console.error({ uri });
581582
const client = new UnifiedMongoClient(uri, entity.client);
582583
try {
583584
new EntityEventRegistry(client, entity.client, map).register();

0 commit comments

Comments
 (0)