Skip to content

test: fix fastify TAV test failures #3314

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 3, 2023
Merged

Conversation

trentm
Copy link
Member

@trentm trentm commented May 3, 2023

The TAV tests were failing on fastify@3 with this error:
FastifyError [FST_ERR_PLUGIN_VERSION_MISMATCH]: fastify-plugin: @fastify/formbody - expected '4.x' fastify version, '3.29.5' is installed

The '@fastify/formbody' dep used in the sanitize-field-names/fastify.test.js
test file needs to match the fastify major version.

I am somewhat hesitant to add this change, because I think it might
make the fastify TAV tests much longer to run. Each version tested will
be doing an additional npm install step, which is slow.


Test failure log output

From https://github.com/elastic/apm-agent-nodejs/actions/runs/4871077219/jobs/8687616639

...
node_tests_1  | -- installing ["[email protected]"]
node_tests_1  | -- running test "node test/instrumentation/modules/fastify/fastify.test.js" with fastify
node_tests_1  | -- running test "node test/instrumentation/modules/fastify/async-await.test.js" with fastify
node_tests_1  | -- running test "node test/instrumentation/modules/fastify/set-framework.test.js" with fastify
node_tests_1  | -- running test "node test/sanitize-field-names/fastify.test.js" with fastify
node_tests_1  | -- required packages ["[email protected]"]
node_tests_1  | -- installing ["[email protected]"]
node_tests_1  | -- running test "node test/instrumentation/modules/fastify/fastify.test.js" with fastify
node_tests_1  | -- running test "node test/instrumentation/modules/fastify/async-await.test.js" with fastify
node_tests_1  | -- running test "node test/instrumentation/modules/fastify/set-framework.test.js" with fastify
node_tests_1  | -- running test "node test/sanitize-field-names/fastify.test.js" with fastify
node_tests_1  |
node_tests_1  | /app/node_modules/fastify/lib/pluginUtils.js:107
node_tests_1  |   if (!semver.satisfies(this.version, requiredVersion)) throw new FST_ERR_PLUGIN_VERSION_MISMATCH(meta.name, requiredVersion, this.version)
node_tests_1  |                                                               ^
node_tests_1  | FastifyError [FST_ERR_PLUGIN_VERSION_MISMATCH]: fastify-plugin: @fastify/formbody - expected '4.x' fastify version, '3.29.5' is installed
node_tests_1  |     at Object.checkVersion (/app/node_modules/fastify/lib/pluginUtils.js:107:63)
node_tests_1  |     at Object.registerPlugin (/app/node_modules/fastify/lib/pluginUtils.js:121:16)
node_tests_1  |     at Boot.override (/app/node_modules/fastify/lib/pluginOverride.js:28:57)
node_tests_1  |     at Plugin.exec (/app/node_modules/avvio/plugin.js:80:33)
node_tests_1  |     at Boot.loadPlugin (/app/node_modules/avvio/plugin.js:274:10)
node_tests_1  |     at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
node_tests_1  |   code: 'FST_ERR_PLUGIN_VERSION_MISMATCH',
node_tests_1  |   statusCode: 500
node_tests_1  | }
node_tests_1  |
node_tests_1  | Node.js v18.16.0

Repro:

% npm install --no-save fastify@3

% node test/sanitize-field-names/fastify.test.js
TAP version 13
# Running fixtures with fastify
# tests default wildcard handling, with urlencode bodyparsing

/Users/trentm/el/apm-agent-nodejs14/node_modules/fastify/lib/pluginUtils.js:107
  if (!semver.satisfies(this.version, requiredVersion)) throw new FST_ERR_PLUGIN_VERSION_MISMATCH(meta.name, requiredVersion, this.version)
                                                              ^
FastifyError [FST_ERR_PLUGIN_VERSION_MISMATCH]: fastify-plugin: @fastify/formbody - expected '4.x' fastify version, '3.29.5' is installed
    at Object.checkVersion (/Users/trentm/el/apm-agent-nodejs14/node_modules/fastify/lib/pluginUtils.js:107:63)
    at Object.registerPlugin (/Users/trentm/el/apm-agent-nodejs14/node_modules/fastify/lib/pluginUtils.js:121:16)
    at Boot.override (/Users/trentm/el/apm-agent-nodejs14/node_modules/fastify/lib/pluginOverride.js:28:57)
    at Plugin.exec (/Users/trentm/el/apm-agent-nodejs14/node_modules/avvio/plugin.js:80:33)
    at Boot.loadPlugin (/Users/trentm/el/apm-agent-nodejs14/node_modules/avvio/plugin.js:274:10)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  code: 'FST_ERR_PLUGIN_VERSION_MISMATCH',
  statusCode: 500
}

The TAV tests were failing on fastify@3 with this error:
    FastifyError [FST_ERR_PLUGIN_VERSION_MISMATCH]: fastify-plugin: @fastify/formbody - expected '4.x' fastify version, '3.29.5' is installed

The '@fastify/formbody' dep used in the sanitize-field-names/fastify.test.js
test file needs to match the fastify major version.

I am somewhat hesitant to add this change, because I think it might
make the fastify TAV tests much longer to run. Each version tested will
be doing an additional npm install step, which is slow.
@trentm trentm self-assigned this May 3, 2023
@trentm trentm requested a review from david-luna May 3, 2023 20:04
@github-actions github-actions bot added the agent-nodejs Make available for APM Agents project planning. label May 3, 2023
@trentm
Copy link
Member Author

trentm commented May 3, 2023

@david-luna I'm requesting review, but I may go ahead and merge it today to get the build green.

@trentm trentm merged commit 3bd83ae into main May 3, 2023
@trentm trentm deleted the trentm/fix-fastify-tav-tests branch May 3, 2023 20:41
v1v added a commit to v1v/apm-agent-nodejs that referenced this pull request May 8, 2023
…re/support-specific-modules

* 'main' of github.com:elastic/apm-agent-nodejs: (54 commits)
  chore: fix dev-utils/ci-tav-slow-jobs.sh (elastic#3319)
  test: reduce TAV test matrix for slowest jobs (elastic#3321)
  chore: sync package-lock so 'npm ci' can work (elastic#3318)
  docs: document `useElasticTraceparentHeader` config var (elastic#3316)
  chore, test: test driver improvements (elastic#3293)
  test: drop node 14 from RC tests now that it is EOL (elastic#3315)
  test: fix running fastify.test.js with node v8 (elastic#3317)
  feat: add @apollo/server@4 support (elastic#3203)
  chore: update nvm (elastic#3309)
  tests: stop testing 'express-graphql' instrumentation (elastic#3304)
  chore: fix bitrot.js dev util for recent changes (elastic#3308)
  test: restore testing of Azure Functions on node >=18.x (elastic#3307)
  fix: support Lambda instrumentation for `contextManager: 'patch'`; refactor Lambda tests (elastic#3305)
  test: fix fastify TAV test failures (elastic#3314)
  test: fix @aws-sdk/client-s3 TAV test failures (elastic#3312)
  feat: add instrumentation for aws-sdk S3 client (elastic#3287)
  feat(fastify): add captureBody support (elastic#2681)
  feat: mysql2@3 support (elastic#3301)
  chore(deps): bump @opentelemetry/exporter-prometheus from 0.37.0 to 0.38.0 in /test/opentelemetry-metrics/fixtures (elastic#3295)
  chore(deps-dev): bump fastify from 4.16.3 to 4.17.0 (elastic#3296)
  ...
trentm added a commit that referenced this pull request May 16, 2023
The TAV tests were failing on fastify@3 with this error:
    FastifyError [FST_ERR_PLUGIN_VERSION_MISMATCH]: fastify-plugin: @fastify/formbody - expected '4.x' fastify version, '3.29.5' is installed

The '@fastify/formbody' dep used in the sanitize-field-names/fastify.test.js
test file needs to match the fastify major version.

I am somewhat hesitant to add this change, because I think it might
make the fastify TAV tests much longer to run. Each version tested will
be doing an additional npm install step, which is slow.
PeterEinberger pushed a commit to fpm-git/apm-agent-nodejs that referenced this pull request Aug 20, 2024
The TAV tests were failing on fastify@3 with this error:
    FastifyError [FST_ERR_PLUGIN_VERSION_MISMATCH]: fastify-plugin: @fastify/formbody - expected '4.x' fastify version, '3.29.5' is installed

The '@fastify/formbody' dep used in the sanitize-field-names/fastify.test.js
test file needs to match the fastify major version.

I am somewhat hesitant to add this change, because I think it might
make the fastify TAV tests much longer to run. Each version tested will
be doing an additional npm install step, which is slow.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
agent-nodejs Make available for APM Agents project planning.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant