Skip to content

Makefiles do not install test deps completely  #1218

@the-simmon

Description

@the-simmon

🐞 Bug report

Describe the bug

Running make test or make integration-tests in a hook folder does not install npm depencies from /tests/integration. The CI does this step manually.

Steps To Reproduce

git clone https://github.com/secureCodeBox/secureCodeBox.git
cd hooks/cascading-scans
make test

Expected behavior

Integration tests should work

Screenshots / Logs

> @securecodebox/hook-cascading-scans@1.0.0 build
> npx tsc hook.ts --sourceMap --esModuleInterop

 FAIL  integration-tests/cascade-nmap-ncrack.test.js
  ● Test suite failed to run

    Cannot find module '@kubernetes/client-node' from '../../../tests/integration/helpers.js'

    Require stack:
      /tmp/secureCodeBox/tests/integration/helpers.js
      integration-tests/cascade-nmap-ncrack.test.js

      3 | // SPDX-License-Identifier: Apache-2.0
      4 |
    > 5 | const k8s = require("@kubernetes/client-node");
        |             ^
      6 |
      7 | const kc = new k8s.KubeConfig();
      8 | kc.loadFromDefault();

      at Resolver.resolveModule (node_modules/jest-resolve/build/resolver.js:324:11)
      at Object.<anonymous> (../../../tests/integration/helpers.js:5:13)

Fix

Run npm ci in /tests/integration

Metadata

Metadata

Assignees

Labels

bugBugsplannedIssues we will do in the next sprint.testingImprovements or additions regarding the test setup

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions