#1027865 Cannot build for backports: fails test "npm package contains only the expected entries in the package dir"

#1027865#5
Date:
2023-01-04 09:37:29 UTC
From:
To:
Hi,

I'm trying to backport node-jasmine to bullseye (see
https://bugs.debian.org/973617 for the reason).  Unfortunately, one of
the tests fails:

Failures:
1) npm package contains only the expected entries in the package dir
  Message:
    Expected $.length = 6 to equal 5.
    Expected $[0] = 'CHANGELOG.md' to equal 'MIT.LICENSE'.
    Expected $[1] = 'MIT.LICENSE' to equal 'README.md'.
    Expected $[2] = 'README.md' to equal 'bin'.
    Expected $[3] = 'bin' to equal 'lib'.
    Expected $[4] = 'lib' to equal 'package.json'.
    Unexpected $[5] = 'package.json' in array.
  Stack:
        at <Jasmine>
        at UserContext.<anonymous> (/home/user/node-jasmine-4.5.0+~cs8.8.0/spec/npm_package_spec.js:54:19)
        at <Jasmine>

I thought it might be to do with an older version of dh-nodejs, but
even upgrading to the current testing version of dh-nodejs made no
difference - I still get the same error.

Any ideas what might be causing this?  I could always just skip this
test if it's an innocuous issue.

Best wishes,

   Julian

#1027865#10
Date:
2023-01-04 10:13:22 UTC
From:
To:
Le mer. 4 janv. 2023 à 10:39, Julian Gilbey <jdg@debian.org> a écrit :

This test fails because CHANGELOG.md shouldn't be there - it indeed is not
in the upstream source.

Jérémy

#1027865#15
Date:
2023-01-04 11:00:54 UTC
From:
To:
Hi Jérémy,

Indeed, the test failure message is quite explicit about this.  The
test passes on bookworm (testing) but not on bullseye (+
bullseye-backports) and I don't understand why.

Note that CHANGELOG.md is generated during the build process, and your
comment made me wonder whether somehow it has slipped into the test.
It is feasible that one of the build-dependencies has changed
behaviour between bullseye and bookworm, something like dh-nodejs, in
which case we might need a versioned depends on something, but I don't
know what.  (I tried upgrading dh-nodejs, but it didn't help.)
debian/clean lists it as a file to delete on clean.

But it turns out that adding the following to debian/rules allows the
tests to all succeed:

execute_before_dh_auto_test:
        mv CHANGELOG.md debian

execute_after_dh_auto_test:
        mv debian/CHANGELOG.md .

Thanks for that prod!

Best wishes,

   Julian