Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

[SYNTH-16108] Show error stack trace and cause #1438

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Drarig29
Copy link
Contributor

@Drarig29 Drarig29 commented Sep 5, 2024

What and why?

Before:

$ yarn launch synthetics run-tests -s 'test:('

 ERROR: unable to obtain test configurations with search query 
Request failed with status code 400

After:

$ yarn launch synthetics run-tests -s 'test:('

 ERROR: unable to obtain test configurations 
CriticalError: Failed to search tests with query: query on https://api.datadoghq.com/api/v1/synthetics/tests/search returned: "Make sure there is no missing parentheses"
    at /Users/corentin.girard/go/src/github.com/DataDog/datadog-ci.git/master/src/commands/synthetics/run-tests-lib.ts:85:11
    at Generator.throw (<anonymous>)
    at rejected (/Users/corentin.girard/go/src/github.com/DataDog/datadog-ci.git/master/src/commands/synthetics/run-tests-lib.ts:6:65)
    at processTicksAndRejections (node:internal/process/task_queues:95:5) {
  code: 'UNAVAILABLE_TEST_CONFIG',
  [cause]: EndpointError: Failed to search tests with query: query on https://api.datadoghq.com/api/v1/synthetics/tests/search returned: "Make sure there is no missing parentheses"
      at /Users/corentin.girard/go/src/github.com/DataDog/datadog-ci.git/master/src/commands/synthetics/test.ts:81:11
      at Generator.throw (<anonymous>)
      at rejected (/Users/corentin.girard/go/src/github.com/DataDog/datadog-ci.git/master/src/commands/synthetics/test.ts:6:65)
      at processTicksAndRejections (node:internal/process/task_queues:95:5) {
    status: 400
  }
}

How?

For each error that we catch and want to re-throw, we now attach it as a cause on the new error.

Review checklist

  • Feature or bugfix MUST have appropriate tests (unit, integration)

@Drarig29 Drarig29 added the synthetics Related to [synthetics] label Sep 5, 2024
@datadog-datadog-prod-us1
Copy link

datadog-datadog-prod-us1 bot commented Sep 5, 2024

Datadog Report

Branch report: corentin.girard/SYNTH-16108/show-error-stack-trace-with-cause
Commit report: 75d69b8
Test service: datadog-ci-tests

✅ 0 Failed, 416 Passed, 0 Skipped, 52.78s Total duration (2m 34.9s time saved)

@Drarig29 Drarig29 marked this pull request as ready for review September 10, 2024 16:20
@Drarig29 Drarig29 requested review from a team as code owners September 10, 2024 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
synthetics Related to [synthetics]
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant