Skip to content

Commit 1df1206

Browse files
duncanpharveyrochdev
authored andcommitted
ci(azure-functions): install azure-functions-core-tools outside of test suite (#6242)
* install azure-functions-core-tools outside of test suite * install azure-functions-core-tools with npm * add azurite service for azure functions tests
1 parent 3012218 commit 1df1206

File tree

3 files changed

+19
-5
lines changed

3 files changed

+19
-5
lines changed

.github/workflows/serverless.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,12 @@ jobs:
9797
azure-functions:
9898
runs-on: ubuntu-latest
9999
services:
100+
azurite:
101+
image: mcr.microsoft.com/azure-storage/azurite:3.34.0
102+
ports:
103+
- "127.0.0.1:10000:10000"
104+
- "127.0.0.1:10001:10001"
105+
- "127.0.0.1:10002:10002"
100106
azureservicebusemulator:
101107
image: mcr.microsoft.com/azure-messaging/servicebus-emulator:1.1.2
102108
ports:
@@ -118,6 +124,9 @@ jobs:
118124
SERVICES: azureservicebusemulator,azuresqledge
119125
steps:
120126
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
127+
- uses: ./.github/actions/node
128+
- run: npm install -g [email protected]
129+
- run: echo "$(dirname $(which func))" >> $GITHUB_PATH
121130
- uses: ./.github/actions/plugins/test
122131

123132
azure-service-bus:

docker-compose.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@ services:
33
image: aerospike:ce-6.4.0.3
44
ports:
55
- "127.0.0.1:3000-3002:3000-3002"
6+
azurite:
7+
image: mcr.microsoft.com/azure-storage/azurite:3.34.0
8+
ports:
9+
- "127.0.0.1:10000:10000"
10+
- "127.0.0.1:10001:10001"
11+
- "127.0.0.1:10002:10002"
612
azureservicebusemulator:
713
image: mcr.microsoft.com/azure-messaging/servicebus-emulator:1.1.2
814
ports:

packages/datadog-plugin-azure-functions/test/integration-test/client.spec.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ describe('esm', () => {
2222
this.timeout(120_000)
2323
sandbox = await createSandbox([
2424
`@azure/functions@${version}`,
25-
2625
2726
],
2827
false,
@@ -45,7 +44,7 @@ describe('esm', () => {
4544

4645
it('is instrumented', async () => {
4746
const envArgs = {
48-
PATH: `${sandbox.folder}/node_modules/azure-functions-core-tools/bin:${process.env.PATH}`
47+
PATH: process.env.PATH
4948
}
5049
proc = await spawnPluginIntegrationTestProc(sandbox.folder, 'func', ['start'], agent.port, undefined, envArgs)
5150

@@ -61,7 +60,7 @@ describe('esm', () => {
6160

6261
it('propagates context to child http requests', async () => {
6362
const envArgs = {
64-
PATH: `${sandbox.folder}/node_modules/azure-functions-core-tools/bin:${process.env.PATH}`
63+
PATH: process.env.PATH
6564
}
6665
proc = await spawnPluginIntegrationTestProc(sandbox.folder, 'func', ['start'], agent.port, undefined, envArgs)
6766

@@ -73,7 +72,7 @@ describe('esm', () => {
7372

7473
it('propagates context through a service bus queue', async () => {
7574
const envArgs = {
76-
PATH: `${sandbox.folder}/node_modules/azure-functions-core-tools/bin:${process.env.PATH}`
75+
PATH: process.env.PATH
7776
}
7877
proc = await spawnPluginIntegrationTestProc(sandbox.folder, 'func', ['start'], agent.port, undefined, envArgs)
7978

@@ -91,7 +90,7 @@ describe('esm', () => {
9190

9291
it('propagates context through a service bus topic', async () => {
9392
const envArgs = {
94-
PATH: `${sandbox.folder}/node_modules/azure-functions-core-tools/bin:${process.env.PATH}`
93+
PATH: process.env.PATH
9594
}
9695
proc = await spawnPluginIntegrationTestProc(sandbox.folder, 'func', ['start'], agent.port, undefined, envArgs)
9796

0 commit comments

Comments
 (0)