Add image integration test in retire.js to ensure native modules can be compiled
Problem to solve
The Dockerfile
for the retire.js analyzer was updated in this MR to add the make
tool to allow compiling native modules such as node-gyp, although this wasn't sufficient, since g++
is also required:
> node-gyp rebuild
make: Entering directory '/builds/gitterHQ/webapp/node_modules/cld/build'
CXX(target) Release/obj.target/cld-c/deps/cld/internal/cldutil.o
make: g++: No such file or directory
make: *** [deps/cld/cld-c.target.mk:141: Release/obj.target/cld-c/deps/cld/internal/cldutil.o] Error 127
make: Leaving directory '/builds/gitterHQ/webapp/node_modules/cld/build'
gyp ERR! build error
Another MR has been created to fix this issue by adding the alpine-sdk
metapackage, however, we should add an integration test to ensure that we've actually solved the problem and demonstrate that it's indeed possible to compile native modules.
The purpose of this issue is to add a new image integration test to retire.js
to ensure that node packages that rely on g++
and make
can be installed, such as cld.
Proposal
-
Copy the image test
job fromgemnasium
and add it to the retire.js.gitlab-ci.yml
file -
Add a Gemfile
and newspec
directory toretire.js
which tests to ensure that a native module can be built:docker run -t --rm registry.gitlab.com/gitlab-org/security-products/analyzers/retire.js npm install cld
The exit code of the above command should be
0
if successful. The test should check to ensure this is the case
Intended users
Further details
See this comment for more details on why this is necessary.
What does success look like, and how can we measure that?
Test is added to ensure node modules can be compiled
What is the type of buyer?
GitLab Ultimate Enterprise Edition
Is this a cross-stage feature?
No, this only affects ~"Category:Dependency Scanning"