citgm icon indicating copy to clipboard operation
citgm copied to clipboard

feature: add way of testing deps of a module

Open andrewhughes101 opened this issue 6 years ago • 9 comments

New feature to test all the dependencies of a module. This will test the versions of the dependencies that get installed at the time of npm install. Current work in progress tests and documentation to come. Please let me know if this should be intergarted into citgm or citgm-all - help would be appreciated on how to do this

Checklist
  • [x] npm test passes
  • [ ] tests are included
  • [ ] documentation is changed or added
  • [x] contribution guidelines followed here

andrewhughes101 avatar Oct 31 '19 12:10 andrewhughes101

Refs #631 could be used to automate this

andrewhughes101 avatar Oct 31 '19 12:10 andrewhughes101

Codecov Report

Merging #765 into master will not change coverage. The diff coverage is n/a.

Impacted file tree graph

@@          Coverage Diff           @@
##           master    #765   +/-   ##
======================================
  Coverage    95.5%   95.5%           
======================================
  Files          27      27           
  Lines         889     889           
======================================
  Hits          849     849           
  Misses         40      40

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 5c3967d...bd38d3f. Read the comment docs.

codecov-io avatar Nov 01 '19 08:11 codecov-io

@richardlau I think an alternative way of producing this functionality would be to add an optional version field to the lookup for each module that citgm-all can handle. Then all that citgm-deps would do is the npm install and grab the versions of each dependency.

@nodejs/citgm opinions on adding an optional version field to the lookup?

andrewhughes101 avatar Nov 01 '19 11:11 andrewhughes101

ping @nodejs/citgm on behalf of @andrewhughes101

BethGriggs avatar Nov 04 '19 16:11 BethGriggs

I'm not 100% that this is the best way to approach the problem outlined in #631

Generally packages don't "just work" with CITGM. Usually we have to manually add them to the lookup table including meta data such as version prefix, package manager default, and what platforms that module is flaky on.

If we automate the process of testing all of the dependencies installed I fear we will end up with a ton of false negatives and in turn have to manually add all of those dependencies into the lookup table before we can get accurate results. At that point a CITGM-ALL run will cover all those dependencies.

We could likely use tags to similarly filter subsets of modules if we wanted to only test supported modules. A script that automated updating the lookup.json with tags that grouped related modules would likely be very helpful for that.

I'm not going to block this, but would like to hear a bit more about how this will be used and how the data we get from the script will be useful before supporting this feature

MylesBorins avatar Nov 05 '19 00:11 MylesBorins

I agree with @MylesBorins that this might end up with a lot of flaky tests in the test suite. It might be a good idea to try to automate a few more things that we require less meta data (e.g., the version prefix and the default package manager could be detected). What platforms a module is flaky on is something difficult to automate though.

I think this is a good idea on a longer term. I am just not sure if we are already at the point that this works as expected.

BridgeAR avatar Nov 06 '19 21:11 BridgeAR

@BridgeAR, @MylesBorins when this work was mentioned to me it was in the context of helping projects run test themselves (for example the Express project) which I think would be useful and a good extension of CITGM.

I'm thinking we should add the functionality to do that in a way that does not affect our existing CITGM runs (ie we won't need to worry about any flakiness) but does let package maintainers experiment with using CITGM to do additional testing. What do you think?

mhdawson avatar Nov 06 '19 22:11 mhdawson

The plan was to implement this as a new command and not add it to the CITGM runs. This is so it could be used by module maintainers to test their module dependencies using CITGM without affecting existing nodejs CI test runs.

If there are features that module maintainers could use in CITGM, then visibility of CITGM could be increased, potentially leading to more contributors?

andrewhughes101 avatar Dec 05 '19 11:12 andrewhughes101

/cc @ljharb who was just talking to me about smoketesting needs as a module author

MylesBorins avatar Dec 05 '19 17:12 MylesBorins