Skip to content

Commit

Permalink
Fix the CI build to include intentional failures
Browse files Browse the repository at this point in the history
In the package mergers of PR #545, we merged the `nodejs-ext` package in
the `nodejs` package.

The tests that belong to the `nodejs-ext` package that tested the
behavior when the extension failed to install were not run after merging
that PR.

I've updated the build matrix to run those tests for the `nodejs`
package now.

For Jest I also had to configure a new root directory. In the
`nodejs-ext` package this was not configure, so I assume it previously
searched in all subdirectories.

For the clean command I also had to add the `build` directory be cleaned
up, otherwise it would continue to load the loaded extension without
problem.

[skip changeset]
  • Loading branch information
tombruijn committed Jan 19, 2022
1 parent 58f1ae0 commit 6e041c4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
4 changes: 4 additions & 0 deletions .semaphore/semaphore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ blocks:
- name: "@appsignal/nodejs - nodejs"
commands:
- mono test --package=@appsignal/nodejs
- mono run --package @appsignal/nodejs -- npm run test:failure
- name: "@appsignal/nodejs - nodejs - diagnose"
commands:
- git submodule init
Expand Down Expand Up @@ -206,6 +207,7 @@ blocks:
- name: "@appsignal/nodejs - nodejs"
commands:
- mono test --package=@appsignal/nodejs
- mono run --package @appsignal/nodejs -- npm run test:failure
- name: "@appsignal/nodejs - nodejs - diagnose"
commands:
- git submodule init
Expand Down Expand Up @@ -299,6 +301,7 @@ blocks:
- name: "@appsignal/nodejs - nodejs"
commands:
- mono test --package=@appsignal/nodejs
- mono run --package @appsignal/nodejs -- npm run test:failure
- name: "@appsignal/nodejs - nodejs - diagnose"
commands:
- git submodule init
Expand Down Expand Up @@ -392,6 +395,7 @@ blocks:
- name: "@appsignal/nodejs - nodejs"
commands:
- mono test --package=@appsignal/nodejs
- mono run --package @appsignal/nodejs -- npm run test:failure
- name: "@appsignal/nodejs - nodejs - diagnose"
commands:
- git submodule init
Expand Down
6 changes: 1 addition & 5 deletions build_matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,8 @@ matrix:
- git submodule init
- git submodule update
- LANGUAGE=nodejs test/integration/diagnose/bin/test
- package: "@appsignal/nodejs-ext"
path: "packages/nodejs-ext"
variations:
- name: "nodejs-ext"
extra_commands:
- mono run --package @appsignal/nodejs-ext -- npm run test:failure
- mono run --package @appsignal/nodejs -- npm run test:failure
# Library integrations
- package: "@appsignal/apollo-server"
path: "packages/apollo-server"
Expand Down
2 changes: 1 addition & 1 deletion packages/nodejs/jest.config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module.exports = {
preset: "ts-jest",
testEnvironment: "node",
roots: ["<rootDir>/src"],
roots: ["<rootDir>/src", "<rootDir>/scripts"],
transform: {
"^.+\\.tsx?$": "ts-jest"
}
Expand Down
7 changes: 4 additions & 3 deletions packages/nodejs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@
"scripts": {
"build": "tsc -p tsconfig.json",
"build:watch": "tsc -p tsconfig.json -w --preserveWatchOutput",
"clean": "rimraf dist coverage && rimraf ext/appsignal-agent ext/libappsignal.a ext/appsignal.* ext/*.tar.gz",
"clean": "rimraf dist coverage build && rimraf ext/appsignal-agent ext/libappsignal.a ext/appsignal.* ext/*.tar.gz ext/*.report",
"install": "node scripts/extension/extension.js",
"link:npm": "npm link",
"link:yarn": "yarn link",
"test": "jest --filter=./test/filter.js",
"test:ext:failure": "_TEST_APPSIGNAL_EXTENSION_FAILURE=true _APPSIGNAL_EXTENSION_INSTALL=true npm run install; _TEST_APPSIGNAL_EXTENSION_FAILURE=true jest --filter=./test/filter.js",
"test:watch": "jest --filter=./test/filter.js --watch"
"test:watch": "jest --filter=./test/filter.js --watch",
"pretest:failure": "npm run clean",
"test:failure": "_TEST_APPSIGNAL_EXTENSION_FAILURE=true _APPSIGNAL_EXTENSION_INSTALL=true npm run install; _TEST_APPSIGNAL_EXTENSION_FAILURE=true jest --filter=./test/filter.js"
},
"os": [
"linux",
Expand Down

0 comments on commit 6e041c4

Please sign in to comment.