Skip to content

Commit

Permalink
call func start directly and remove find-process dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
duncanpharvey committed Oct 9, 2024
1 parent a088120 commit 4a6c8a6
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 24 deletions.
1 change: 0 additions & 1 deletion LICENSE-3rdparty.csv
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ dev,eslint-plugin-mocha,MIT,Copyright 2014 Mathias Schreck
dev,eslint-plugin-n,MIT,Copyright 2015 Toru Nagashima
dev,eslint-plugin-promise,ISC,jden and other contributors
dev,express,MIT,Copyright 2009-2014 TJ Holowaychuk 2013-2014 Roman Shtylman 2014-2015 Douglas Christopher Wilson
dev,find-process,MIT,Copyright (c) 2016 Zoujie
dev,get-port,MIT,Copyright Sindre Sorhus
dev,glob,ISC,Copyright Isaac Z. Schlueter and Contributors
dev,graphql,MIT,Copyright 2015 Facebook Inc.
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@
"eslint-plugin-n": "^16.6.2",
"eslint-plugin-promise": "^6.4.0",
"express": "^4.18.2",
"find-process": "^1.4.7",
"get-port": "^3.2.0",
"glob": "^7.1.6",
"graphql": "0.13.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ const {
} = require('../../../../integration-tests/helpers')
const { spawn } = require('child_process')
const { assert } = require('chai')
const findProcess = require('find-process')

describe('esm', () => {
let agent
Expand All @@ -32,17 +31,13 @@ describe('esm', () => {
})

afterEach(async () => {
const azureFuncProc = await findProcess('name', 'func', true)
const azureFuncProcPid = azureFuncProc[0]?.pid ?? null
azureFuncProcPid !== null && process.kill(azureFuncProcPid, 'SIGKILL')

proc && proc.kill()
proc && proc.kill('SIGINT')
await agent.stop()
})

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

Expand Down Expand Up @@ -90,7 +85,7 @@ function spawnProc (command, args, options = {}, stdioHandler, stderrHandler) {
if (!options.silent) console.log(data.toString())

if (data.toString().includes('http://localhost:7071/api/httptest')) {
resolve()
resolve(proc)
}
})

Expand Down
14 changes: 0 additions & 14 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1370,11 +1370,6 @@ combined-stream@^1.0.6, combined-stream@^1.0.8:
dependencies:
delayed-stream "~1.0.0"

commander@^5.1.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-5.1.0.tgz#46abbd1652f8e059bddaef99bbdcb2ad9cf179ae"
integrity sha512-P0CysNDQ7rtVw4QIQtm+MRxV66vKFSvlsQvGYXZWR3qFU0jlMKHZZZgw8e+8DSah4UDKMqnknRDQz+xuQXQ/Zg==

commander@^9.1.0:
version "9.5.0"
resolved "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz"
Expand Down Expand Up @@ -2141,15 +2136,6 @@ find-cache-dir@^3.2.0:
make-dir "^3.0.2"
pkg-dir "^4.1.0"

find-process@^1.4.7:
version "1.4.7"
resolved "https://registry.yarnpkg.com/find-process/-/find-process-1.4.7.tgz#8c76962259216c381ef1099371465b5b439ea121"
integrity sha512-/U4CYp1214Xrp3u3Fqr9yNynUrr5Le4y0SsJh2lMDDSbpwYSz3M2SMWQC+wqcx79cN8PQtHQIL8KnuY9M66fdg==
dependencies:
chalk "^4.0.0"
commander "^5.1.0"
debug "^4.1.1"

[email protected], find-up@^5.0.0:
version "5.0.0"
resolved "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz"
Expand Down

0 comments on commit 4a6c8a6

Please sign in to comment.