@@ -16,7 +16,12 @@ Execute this script in your GitLab CI's job YAML before running the tests. Pass
16
16
test_node :
17
17
image : node:latest
18
18
script :
19
- - LANGUAGES="js" SITE="datadoghq.com" API_KEY="YOUR_API_KEY_SECRET" source <(curl -Ls https://github.com/DataDog/test-optimization-gitlab-script/releases/download/v1.2.3/script.sh)
19
+ - |
20
+ LANGUAGES="js" SITE="datadoghq.com" API_KEY="YOUR_API_KEY_SECRET" \
21
+ SRC=$(curl -fsSL https://github.com/DataDog/test-optimization-gitlab-script/releases/download/v1.2.5/script.sh); \
22
+ echo "$SRC" | sha256sum | grep -q '^2932579e425337d91244232bc6ea2b549e2600703322896ab05a49877b6434e6' && \
23
+ source <(echo "$SRC") || \
24
+ echo "ERROR: SHA256 mismatch. Datadog Test Optimization autoinstrumentation not enabled." >&2
20
25
- npm run test
21
26
` ` `
22
27
@@ -49,7 +54,12 @@ test_node:
49
54
- export DD_API_KEY="YOUR_API_KEY_SECRET"
50
55
- export DD_ENV="staging-tests"
51
56
- export DD_TAGS="layer:api,team:intake,key:value"
52
- - LANGUAGES="js" SITE="datad0g.com" source <(curl -Ls https://github.com/DataDog/test-optimization-gitlab-script/releases/download/v1.2.3/script.sh)
57
+ - |
58
+ LANGUAGES="js" SITE="datadoghq.com" \
59
+ SRC=$(curl -fsSL https://github.com/DataDog/test-optimization-gitlab-script/releases/download/v1.2.5/script.sh); \
60
+ echo "$SRC" | sha256sum | grep -q '^2932579e425337d91244232bc6ea2b549e2600703322896ab05a49877b6434e6' && \
61
+ source <(echo "$SRC") || \
62
+ echo "ERROR: SHA256 mismatch. Datadog Test Optimization autoinstrumentation not enabled." >&2
53
63
- npm run test
54
64
` ` `
55
65
@@ -65,7 +75,12 @@ To use this script with vitest you need to modify the NODE_OPTIONS environment v
65
75
test_node_vitest:
66
76
image: node:latest
67
77
script:
68
- - LANGUAGES="js" SITE="datadoghq.com" API_KEY="YOUR_API_KEY_SECRET" source <(curl -Ls https://github.com/DataDog/test-optimization-gitlab-script/releases/download/v1.2.3/script.sh)
78
+ - |
79
+ LANGUAGES="js" SITE="datadoghq.com" API_KEY="YOUR_API_KEY_SECRET" \
80
+ SRC=$(curl -fsSL https://github.com/DataDog/test-optimization-gitlab-script/releases/download/v1.2.5/script.sh); \
81
+ echo "$SRC" | sha256sum | grep -q '^2932579e425337d91244232bc6ea2b549e2600703322896ab05a49877b6434e6' && \
82
+ source <(echo "$SRC") || \
83
+ echo "ERROR: SHA256 mismatch. Datadog Test Optimization autoinstrumentation not enabled." >&2
69
84
- export NODE_OPTIONS="$NODE_OPTIONS --import $DD_TRACE_ESM_IMPORT"
70
85
- npm run test
71
86
` ` `
0 commit comments