Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[test optimization] [dev] [wip] Bump dd-trace #1950

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 features/support/tracer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function wrap(method: any) {
return tracer.trace(
"fetch",
{ type: "http", resource: request.getUrl() },
(span: any, callback?: (error?: Error) => string) => {
(span: any, callback?: (error?: Error) => void) => {
const carrier: { [name: string]: string } = {};
tracer.inject(span, HTTP_HEADERS, carrier);
for (const name in carrier) {
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": "^4.3.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
Loading
Loading