Skip to content

Commit

Permalink
test(prisma): fix prisma test, prisma requires Node.js >= 14.x
Browse files Browse the repository at this point in the history
Also:
* Explicitly add the package `prisma` to the prisma app's package.json
  file, this package contains the necessary CLI tools
  (prisma generate etc.). Previously this was installed implicitly as
  an optional peer dependency.
* Convert the package-lock.json file to lockfile format version 1. As
  long as we run tests with older Node.js versions which come with
  older npm versions, this is safer than depending on old npm versions
  understanding newer lockfile formats.
  • Loading branch information
basti1302 committed Nov 3, 2022
1 parent 957add6 commit d1c9ee5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 67 deletions.
69 changes: 3 additions & 66 deletions packages/collector/test/tracing/database/prisma/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions packages/collector/test/tracing/database/prisma/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@
"license": "MIT",
"dependencies": {
"@prisma/client": "^4.5.0"
},
"devDependencies": {
"prisma": "^4.5.0"
}
}
4 changes: 3 additions & 1 deletion packages/collector/test/tracing/database/prisma/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ const fs = require('fs').promises;
const path = require('path');
const recursiveCopy = require('recursive-copy');
const rimraf = require('util').promisify(require('rimraf'));
const semver = require('semver');

const supportedVersion = require('@instana/core').tracing.supportedVersion;
const config = require('../../../../../core/test/config');
Expand All @@ -23,7 +24,8 @@ const appDir = __dirname;
const schemaTargetFile = path.join(appDir, 'prisma', 'schema.prisma');
const migrationsTargetDir = path.join(appDir, 'prisma', 'migrations');

const mochaSuiteFn = supportedVersion(process.versions.node) ? describe : describe.skip;
const mochaSuiteFn =
supportedVersion(process.versions.node) && semver.gte(process.versions.node, '14.17.0') ? describe : describe.skip;

mochaSuiteFn('tracing/prisma', function () {
this.timeout(Math.max(config.getTestTimeout() * 3, 20000));
Expand Down

0 comments on commit d1c9ee5

Please sign in to comment.