Skip to content

Commit

Permalink
use v4 and clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
juan-fernandez committed Dec 10, 2024
1 parent 97023f0 commit 9e36542
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 20 deletions.
7 changes: 7 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@ jobs:
- name: Test
run: ./run-tests.sh
shell: bash
env:
DD_CIVISIBILITY_AGENTLESS_ENABLED: true
DD_API_KEY: ${{ secrets.DD_API_KEY }}
NODE_OPTIONS: -r dd-trace/ci/init
DD_ENV: prod
DD_SERVICE: datadog-api-client-typescript
DD_TAGS: "team:integrations-tools-and-libraries"

examples:
runs-on: ubuntu-latest
Expand Down
13 changes: 3 additions & 10 deletions .github/workflows/test_integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,6 @@ jobs:
!contains(github.event.pull_request.head.ref, 'datadog-api-spec/test/') &&
contains(github.event.pull_request.labels.*.name, 'ci/integrations')) ||
github.event_name == 'schedule'
services:
datadog-agent:
image: gcr.io/datadoghq/agent:latest
ports:
- 8126:8126
env:
DD_API_KEY: ${{ secrets.DD_API_KEY }}
DD_HOSTNAME: "none"
DD_INSIDE_CI: "true"
steps:
- name: Get GitHub App token
if: github.event_name == 'pull_request'
Expand Down Expand Up @@ -69,7 +60,6 @@ jobs:
shell: bash
env:
CI: "true"
DD_AGENT_HOST: localhost
DD_ENV: prod
DD_SERVICE: datadog-api-client-typescript
DD_TAGS: "team:integrations-tools-and-libraries"
Expand All @@ -78,6 +68,9 @@ jobs:
DD_TEST_CLIENT_APP_KEY: ${{ secrets.DD_CLIENT_APP_KEY }}
RECORD: "none"
SLEEP_AFTER_REQUEST: "${{ vars.SLEEP_AFTER_REQUEST }}"
DD_CIVISIBILITY_AGENTLESS_ENABLED: true
DD_API_KEY: ${{ secrets.DD_API_KEY }}
NODE_OPTIONS: -r dd-trace/ci/init
- name: Post failure status check
if: failure() && github.event_name == 'pull_request' && contains(github.event.pull_request.head.ref, 'datadog-api-spec/generated/')
uses: DataDog/github-actions/post-status-check@v2
Expand Down
3 changes: 0 additions & 3 deletions bin/dd-cucumber-js
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/usr/bin/env node

if (process.env.DD_AGENT_HOST != undefined) {
require('dd-trace/ci/init');
}
require('@cucumber/cucumber/lib/cli/run').default();
2 changes: 0 additions & 2 deletions cucumber.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
const feature = [
// NOTE: use bin/dd-cucumber-js to enable dd-trace
// process.env.DD_AGENT_HOST ? '--require-module dd-trace/ci/init' : '',
'--require-module ts-node/register',
'--require features/**/*.ts',
`--format ${process.env.CI || !process.stdout.isTTY ? 'progress' : 'progress-bar'
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
"@typescript-eslint/parser": "^5.54.0",
"chai": "^4.3.7",
"chai-quantifiers": "^1.0.17",
"dd-trace": "^5.28.0",
"dd-trace": "4.52.0",
"eslint": "^8.43.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-node": "^11.1.0",
Expand Down
8 changes: 8 additions & 0 deletions run-tests.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/usr/bin/env bash

# Save the original NODE_OPTIONS value
ORIGINAL_NODE_OPTIONS=$NODE_OPTIONS
# Set NODE_OPTIONS to empty
export NODE_OPTIONS=""

function finish {
rm -rf @rerun.txt
}
Expand All @@ -15,6 +20,9 @@ set +e
yarn run check-licenses || exit 1


# Reset NODE_OPTIONS to its original value, just for the tests
export NODE_OPTIONS=$ORIGINAL_NODE_OPTIONS

# Run unit tests
if [ "${RECORD:-false}" == "false" ]; then
yarn run jest-test
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1962,10 +1962,10 @@ dc-polyfill@^0.1.4:
resolved "https://registry.yarnpkg.com/dc-polyfill/-/dc-polyfill-0.1.6.tgz#c2940fa68ffb24a7bf127cc6cfdd15b39f0e7f02"
integrity sha512-UV33cugmCC49a5uWAApM+6Ev9ZdvIUMTrtCO9fj96TPGOQiea54oeO3tiEVdVeo3J9N2UdJEmbS4zOkkEA35uQ==

dd-trace@^5.28.0:
version "5.28.0"
resolved "https://registry.yarnpkg.com/dd-trace/-/dd-trace-5.28.0.tgz#70d10d9b6372fe7f54d539026a53f8a1b10ea8d3"
integrity sha512-jyF7JLx2Yw16MHcD97sYKXbVd7ZT1hKJ5/NkRRGeG9cgen5+d/ilIvfzgh2qRjeow+9a5ligoZoUOYJ3nYn9hw==
dd-trace@4.52.0:
version "4.52.0"
resolved "https://registry.yarnpkg.com/dd-trace/-/dd-trace-4.52.0.tgz#8a879f2dbd41523e05841dd46c212750822eb753"
integrity sha512-aBO/bozGBGKdmktSiaobPJ0G+FF8cE7txImrs5TmJCEUUZ3xup5pT+Vk1OkntCXyQKvKJ1iR9dMQypOPUs20+Q==
dependencies:
"@datadog/libdatadog" "^0.2.2"
"@datadog/native-appsec" "8.3.0"
Expand Down

0 comments on commit 9e36542

Please sign in to comment.