Skip to content

Commit

Permalink
better
Browse files Browse the repository at this point in the history
  • Loading branch information
juan-fernandez committed Jan 26, 2024
1 parent 020a5ce commit 6302b85
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,33 +25,32 @@ function getKnownTests ({
custom
}, done) {
const options = {
path: '/api/v2/ci/libraries/tests/known_tests',
path: '/api/v2/ci/libraries/tests',
method: 'POST',
headers: {
'Content-Type': 'application/json'
'Content-Type': 'application/json',
'accept-encoding': 'gzip'
},
timeout: 20000,
url
}

if (isEvpProxy) {
options.path = '/evp_proxy/v2/api/v2/ci/libraries/tests/known_tests'
options.path = '/evp_proxy/v2/api/v2/ci/libraries/tests'
options.headers['X-Datadog-EVP-Subdomain'] = 'api'
} else {
const apiKey = process.env.DATADOG_API_KEY || process.env.DD_API_KEY
if (!apiKey) {
return done(new Error('Skippable suites were not fetched because Datadog API key is not defined.'))
}

// It only works in agentless right now. TODO: make it work in agent
options.headers['Accept-encoding'] = 'gzip'
options.headers['dd-api-key'] = apiKey
}

const data = JSON.stringify({
data: {
id: id().toString(10),
type: 'known_test_from_libraries_params',
type: 'ci_app_libraries_tests_request',
attributes: {
configurations: {
'os.platform': osPlatform,
Expand All @@ -73,6 +72,7 @@ function getKnownTests ({
if (err) {
done(err)
} else {
debugger
let knownTests = {}
try {
knownTests = JSON.parse(res)
Expand Down

0 comments on commit 6302b85

Please sign in to comment.