Page MenuHomePhabricator

[4h] Share build and test script from package.json
Closed, ResolvedPublic


We reuse the test scripts identically compared to data-bridge and termbox apart from the names in the no-diff script.

We should sure all the committed built files are tested for differences.

We should make sure all files resulting from the build are used and if needed tested. i.e. there shouldn't be files make that we then ignore.

We should look for an off the shelf solution to check that the above criteria are true.
If that isn't possible we should at least refactor the test:nodiff command to not be a a multiline bash script tucked in package.json (i.e. put it somewhere, parameterise it etc...)

Event Timeline

WMDE-leszek renamed this task from Share build and test script from package.json to [4h] Share build and test script from package.json.Jan 22 2020, 11:46 AM

Seems there isn't an obvious off the shelf solution for this. This closest thing I found was perhaps: or even but these are not at all for diffing to find any differences but more for comparison work.

I spent some time tying to build a small script to nicely automate this in JS. My plan was to try and use vue-cli to run a build progrmatically into e.g. /tmp:
inspect all the files in the output and diff each of those individually with what was committed.

I spent a little time trying to call vue-cli programatically but sadly this looks like a feature that will only be there in vue3. See:

I'm now going to work on implementing basically the same thing in bash.

Change 570876 had a related patch set uploaded (by Tarrow; owner: Tarrow):
[mediawiki/extensions/Wikibase@master] TR: Bash script for diffing webpack

Change 570876 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] TR: Bash script for diffing webpack