Skip to content
Draft
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
4 changes: 2 additions & 2 deletions integration-tests/aiguard/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

const { describe, it, before, after } = require('mocha')
const path = require('path')
const { createSandbox, FakeAgent, spawnProc } = require('../helpers')
const { isolatedSandbox, FakeAgent, spawnProc } = require('../helpers')
const startApiMock = require('./api-mock')
const { expect } = require('chai')
const { executeRequest } = require('./util')
Expand All @@ -12,7 +12,7 @@ describe('AIGuard SDK integration tests', () => {

before(async function () {
this.timeout(process.platform === 'win32' ? 90000 : 30000)
sandbox = await createSandbox(['express'])
sandbox = await isolatedSandbox(['express'])
cwd = sandbox.folder
appFile = path.join(cwd, 'aiguard/server.js')
api = await startApiMock()
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/appsec/data-collection.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const path = require('path')
const Axios = require('axios')

const {
createSandbox,
isolatedSandbox,
FakeAgent,
spawnProc
} = require('../helpers')
Expand All @@ -14,7 +14,7 @@ describe('ASM Data collection', () => {
let axios, sandbox, cwd, appFile, agent, proc

before(async () => {
sandbox = await createSandbox(['express'])
sandbox = await isolatedSandbox(['express'])
cwd = sandbox.folder
appFile = path.join(cwd, 'appsec/data-collection/index.js')
})
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/appsec/endpoints-collection.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ const { describe, before, after, it } = require('mocha')

const path = require('node:path')

const { createSandbox, FakeAgent, spawnProc } = require('../helpers')
const { isolatedSandbox, FakeAgent, spawnProc } = require('../helpers')

describe('Endpoints collection', () => {
let sandbox, cwd

before(async function () {
this.timeout(process.platform === 'win32' ? 90000 : 30000)

sandbox = await createSandbox(
sandbox = await isolatedSandbox(
['fastify'],
false
)
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/appsec/graphql.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ const axios = require('axios')

const {
FakeAgent,
createSandbox,
isolatedSandbox,
spawnProc
} = require('../helpers')

describe('graphql', () => {
let sandbox, cwd, agent, webFile, proc

before(async function () {
sandbox = await createSandbox(['@apollo/server', 'graphql'])
sandbox = await isolatedSandbox(['@apollo/server', 'graphql'])
cwd = sandbox.folder
webFile = path.join(cwd, 'graphql/index.js')
})
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/appsec/iast-esbuild.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const path = require('path')
const { promisify } = require('util')
const msgpack = require('@msgpack/msgpack')

const { createSandbox, FakeAgent, spawnProc } = require('../helpers')
const { isolatedSandbox, FakeAgent, spawnProc } = require('../helpers')

const exec = promisify(childProcess.exec)

Expand All @@ -18,7 +18,7 @@ describe('esbuild support for IAST', () => {
let applicationDir, bundledApplicationDir

before(async () => {
sandbox = await createSandbox([])
sandbox = await isolatedSandbox([])
const cwd = sandbox.folder
applicationDir = path.join(cwd, 'appsec/iast-esbuild')

Expand Down
4 changes: 2 additions & 2 deletions integration-tests/appsec/iast.esm-security-controls.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const { createSandbox, spawnProc, FakeAgent } = require('../helpers')
const { isolatedSandbox, spawnProc, FakeAgent } = require('../helpers')
const path = require('path')
const Axios = require('axios')
const { assert } = require('chai')
Expand All @@ -12,7 +12,7 @@ describe('ESM Security controls', () => {
describe(`With express v${version}`, () => {
before(async function () {
this.timeout(process.platform === 'win32' ? 90000 : 30000)
sandbox = await createSandbox([`express@${version}`])
sandbox = await isolatedSandbox([`express@${version}`])
cwd = sandbox.folder
appFile = path.join(cwd, 'appsec', 'esm-security-controls', 'index.mjs')
})
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/appsec/iast.esm.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const { createSandbox, spawnProc, FakeAgent } = require('../helpers')
const { isolatedSandbox, spawnProc, FakeAgent } = require('../helpers')
const path = require('path')
const Axios = require('axios')
const { assert } = require('chai')
Expand All @@ -10,7 +10,7 @@ describe('ESM', () => {

before(async function () {
this.timeout(process.platform === 'win32' ? 90000 : 30000)
sandbox = await createSandbox(['express'])
sandbox = await isolatedSandbox(['express'])
cwd = sandbox.folder
appFile = path.join(cwd, 'appsec', 'esm-app', 'index.mjs')
})
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/appsec/index.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const path = require('path')
const Axios = require('axios')
const { assert } = require('chai')
const msgpack = require('@msgpack/msgpack')
const { createSandbox, FakeAgent, spawnProc } = require('../helpers')
const { isolatedSandbox, FakeAgent, spawnProc } = require('../helpers')

describe('RASP', () => {
let axios, sandbox, cwd, appFile, agent, proc, stdioHandler
Expand All @@ -14,7 +14,7 @@ describe('RASP', () => {
}

before(async () => {
sandbox = await createSandbox(['express', 'axios'])
sandbox = await isolatedSandbox(['express', 'axios'])
cwd = sandbox.folder
appFile = path.join(cwd, 'appsec/rasp/index.js')
})
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/appsec/multer.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const { describe, it, beforeEach, afterEach, before, after } = require('mocha')
const path = require('node:path')

const {
createSandbox,
isolatedSandbox,
FakeAgent,
spawnProc
} = require('../helpers')
Expand All @@ -18,7 +18,7 @@ describe('multer', () => {
['1.4.4-lts.1', '1.4.5-lts.1'].forEach((version) => {
describe(`v${version}`, () => {
before(async () => {
sandbox = await createSandbox(['express', `multer@${version}`])
sandbox = await isolatedSandbox(['express', `multer@${version}`])
cwd = sandbox.folder
startupTestFile = path.join(cwd, 'appsec', 'multer', 'index.js')
})
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/appsec/response-headers.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const path = require('path')
const Axios = require('axios')

const {
createSandbox,
isolatedSandbox,
FakeAgent,
spawnProc
} = require('../helpers')
Expand All @@ -14,7 +14,7 @@ describe('Headers collection - Fastify', () => {
let axios, sandbox, cwd, appFile, agent, proc

before(async () => {
sandbox = await createSandbox(['fastify'])
sandbox = await isolatedSandbox(['fastify'])
cwd = sandbox.folder
appFile = path.join(cwd, 'appsec/data-collection/fastify.js')
})
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/appsec/standalone-asm.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const { assert } = require('chai')
const path = require('path')

const {
createSandbox,
isolatedSandbox,
FakeAgent,
spawnProc,
curlAndAssertMessage,
Expand All @@ -16,7 +16,7 @@ describe('Standalone ASM', () => {
let sandbox, cwd, startupTestFile, agent, proc, env

before(async () => {
sandbox = await createSandbox(['express'])
sandbox = await isolatedSandbox(['express'])
cwd = sandbox.folder
startupTestFile = path.join(cwd, 'standalone-asm/index.js')
})
Expand Down
6 changes: 3 additions & 3 deletions integration-tests/appsec/trace-tagging.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const path = require('path')
const Axios = require('axios')

const {
createSandbox,
isolatedSandbox,
FakeAgent,
spawnProc
} = require('../helpers')
Expand Down Expand Up @@ -35,7 +35,7 @@ describe('ASM Trace Tagging rules', () => {

describe('express', () => {
before(async () => {
sandbox = await createSandbox(['express'])
sandbox = await isolatedSandbox(['express'])
cwd = sandbox.folder
appFile = path.join(cwd, 'appsec/data-collection/index.js')
})
Expand All @@ -60,7 +60,7 @@ describe('ASM Trace Tagging rules', () => {

describe('fastify', () => {
before(async () => {
sandbox = await createSandbox(['fastify'])
sandbox = await isolatedSandbox(['fastify'])
cwd = sandbox.folder
appFile = path.join(cwd, 'appsec/data-collection/fastify.js')
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const { once } = require('events')
const { assert } = require('chai')

const {
createSandbox,
isolatedSandbox,
getCiVisAgentlessConfig,
getCiVisEvpProxyConfig
} = require('../helpers')
Expand All @@ -19,7 +19,7 @@ describe('test optimization automatic log submission', () => {
let testOutput = ''

before(async () => {
sandbox = await createSandbox([
sandbox = await isolatedSandbox([
'mocha',
'@cucumber/cucumber',
'jest',
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/ci-visibility/git-cache.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const path = require('path')
const os = require('os')
const { execSync } = require('child_process')

const { createSandbox } = require('../helpers')
const { isolatedSandbox } = require('../helpers')

const FIXED_COMMIT_MESSAGE = 'Test commit message for caching'
const GET_COMMIT_MESSAGE_COMMAND_ARGS = ['log', '-1', '--pretty=format:%s']
Expand All @@ -30,7 +30,7 @@ describe('git-cache integration tests', () => {
let originalCacheEnabled, originalCacheDir

before(async () => {
sandbox = await createSandbox([], true)
sandbox = await isolatedSandbox([], true)
cwd = sandbox.folder
testRepoPath = cwd

Expand Down
4 changes: 2 additions & 2 deletions integration-tests/ci-visibility/test-api-manual.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const { exec } = require('child_process')
const { assert } = require('chai')

const {
createSandbox,
isolatedSandbox,
getCiVisAgentlessConfig
} = require('../helpers')
const { FakeCiVisIntake } = require('../ci-visibility-intake')
Expand All @@ -17,7 +17,7 @@ describe('test-api-manual', () => {
let sandbox, cwd, receiver, childProcess

before(async () => {
sandbox = await createSandbox([], true)
sandbox = await isolatedSandbox([], true)
cwd = sandbox.folder
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const { once } = require('events')

const { assert } = require('chai')

const { createSandbox } = require('../helpers')
const { isolatedSandbox } = require('../helpers')
const { FakeCiVisIntake } = require('../ci-visibility-intake')

const packageManagers = ['yarn', 'npm', 'pnpm']
Expand All @@ -14,7 +14,7 @@ describe('test optimization startup', () => {
let sandbox, cwd, receiver, childProcess, processOutput

before(async () => {
sandbox = await createSandbox(packageManagers, true)
sandbox = await isolatedSandbox(packageManagers, true)
cwd = sandbox.folder
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const { once } = require('node:events')
const assert = require('node:assert')
const { exec } = require('child_process')

const { createSandbox, getCiVisAgentlessConfig } = require('../helpers')
const { isolatedSandbox, getCiVisAgentlessConfig } = require('../helpers')
const { FakeCiVisIntake } = require('../ci-visibility-intake')
const { NODE_MAJOR } = require('../../version')

Expand Down Expand Up @@ -55,7 +55,7 @@ testFrameworks.forEach(({ testFramework, command, expectedOutput, extraTestConte
testFrameworks.push('@cucumber/cucumber')
}

sandbox = await createSandbox(testFrameworks, true)
sandbox = await isolatedSandbox(testFrameworks, true)
cwd = sandbox.folder
})

Expand Down
4 changes: 2 additions & 2 deletions integration-tests/code-origin.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
const assert = require('node:assert')
const path = require('node:path')
const Axios = require('axios')
const { FakeAgent, spawnProc, createSandbox } = require('./helpers')
const { FakeAgent, spawnProc, isolatedSandbox } = require('./helpers')

describe('Code Origin for Spans', function () {
let sandbox, cwd, appFile, agent, proc, axios

before(async () => {
sandbox = await createSandbox(['fastify'])
sandbox = await isolatedSandbox(['fastify'])
cwd = sandbox.folder
appFile = path.join(cwd, 'code-origin', 'typescript.js')
})
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/cucumber/cucumber.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const fs = require('fs')
const path = require('path')

const {
createSandbox,
isolatedSandbox,
getCiVisAgentlessConfig,
getCiVisEvpProxyConfig
} = require('../helpers')
Expand Down Expand Up @@ -86,7 +86,7 @@ versions.forEach(version => {
// add an explicit timeout to make tests less flaky
this.timeout(50000)

sandbox = await createSandbox([`@cucumber/cucumber@${version}`, 'assert', 'nyc'], true)
sandbox = await isolatedSandbox([`@cucumber/cucumber@${version}`, 'assert', 'nyc'], true)
cwd = sandbox.folder
})

Expand Down
4 changes: 2 additions & 2 deletions integration-tests/cypress/cypress.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const execPromise = promisify(exec)
const { assert } = require('chai')

const {
createSandbox,
isolatedSandbox,
getCiVisAgentlessConfig,
getCiVisEvpProxyConfig
} = require('../helpers')
Expand Down Expand Up @@ -130,7 +130,7 @@ moduleTypes.forEach(({

before(async () => {
// cypress-fail-fast is required as an incompatible plugin
sandbox = await createSandbox([`cypress@${version}`, '[email protected]'], true)
sandbox = await isolatedSandbox([`cypress@${version}`, '[email protected]'], true)
cwd = sandbox.folder

const { NODE_OPTIONS, ...restOfEnv } = process.env
Expand Down
4 changes: 2 additions & 2 deletions integration-tests/debugger/re-evaluation.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const assert = require('node:assert')

const Axios = require('axios')

const { createSandbox, FakeAgent, assertObjectContains, spawnProc } = require('../helpers')
const { isolatedSandbox, FakeAgent, assertObjectContains, spawnProc } = require('../helpers')
const { generateProbeConfig } = require('../../packages/dd-trace/test/debugger/devtools_client/utils')

// A race condition exists where the tracer receives a probe via RC, before Node.js has had a chance to load all the JS
Expand All @@ -28,7 +28,7 @@ describe('Dynamic Instrumentation Probe Re-Evaluation', function () {
let sandbox

before(async function () {
sandbox = await createSandbox(
sandbox = await isolatedSandbox(
undefined,
undefined,
// Ensure the test scripts live in the root of the sandbox so they are always the shortest path when
Expand Down
Loading
Loading