Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Travis CI - Pull Request: Linting, Deployment job always fails for PR with new js files #11437

Closed
pupitetris opened this issue Jul 30, 2023 · 2 comments · Fixed by #11441
Closed

Comments

@pupitetris
Copy link

pupitetris commented Jul 30, 2023

Fix at the bottom.

Problem

I have a pull request where I recently added a new js file for a new class:

#11372

The file is ./packages/engine/Source/Scene/VRPose.js

After pushing this change to my fork, Travis started failing:

https://app.travis-ci.com/github/CesiumGS/cesium/jobs/606970730

if [ $TRAVIS_BRANCH != "cesium.com" ]; then
  # verify prod package
  mkdir ../test
  cp cesium-*.tgz ../test
  cp Specs/test.*js ../test
  cd ../test
  npm install cesium-*.tgz
  NODE_ENV=development node test.cjs
  NODE_ENV=production node test.cjs
  node test.mjs
fi
added 37 packages in 6s
file:///home/travis/build/CesiumGS/test/node_modules/cesium/Source/Cesium.js:705
export { VRPose } from '@cesium/engine';
         ^^^^^^
SyntaxError: The requested module '@cesium/engine' does not provide an export named 'VRPose'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:190:5)
Node.js v18.17.0
The command "./travis/release.sh" exited with 1.

Diagnosis

The command that is failing is node test.mjs called from travis/release.sh

I have debugged the situation, and it turns out that npm install cesium-*.tgz is pulling @cesium/widgets and @cesium/engine from registry.npmjs.org. After following the Travis job manually, then:

$ npm install --loglevel verbose --dry-run cesium-*.tgz
npm verb cli /home/arturo/.nvm/versions/node/v20.4.0/bin/node /home/arturo/.nvm/versions/node/v20.4.0/bin/npm
npm info using [email protected]
npm info using [email protected]
npm verb title npm install cesium-1.107.2-webxr-poc-webxr-poc123.tgz
npm verb argv "install" "--loglevel" "verbose" "--dry-run" "cesium-1.107.2-webxr-poc-webxr-poc123.tgz"
npm verb logfile logs-max:10 dir:/home/arturo/.npm/_logs/2023-07-30T00_06_20_603Z-
npm verb logfile /home/arturo/.npm/_logs/2023-07-30T00_06_20_603Z-debug-0.log
npm http fetch GET 200 https://registry.npmjs.org/@cesium%2fwidgets 6ms (cache hit) <<<<<<<<
npm http fetch GET 200 https://registry.npmjs.org/@cesium%2fengine 8ms (cache hit) <<<<<<<
npm http fetch GET 200 https://registry.npmjs.org/grapheme-splitter 13ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/autolinker 14ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/earcut 15ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/ktx-parse 14ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/jsep 16ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/@zip.js%2fzip.js 19ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/bitmap-sdf 21ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/@tweenjs%2ftween.js 22ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/pako 19ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/lerc 20ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/protobufjs 20ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/dompurify 25ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/mersenne-twister 24ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/kdbush 25ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/meshoptimizer 24ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/rbush 24ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/topojson-client 26ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/urijs 26ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/nosleep.js 26ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/tslib 16ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/@protobufjs%2faspromise 14ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/@protobufjs%2fbase64 18ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/@protobufjs%2fpath 17ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/@protobufjs%2fpool 17ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/@types%2fnode 19ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/@protobufjs%2feventemitter 25ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/@protobufjs%2finquire 25ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/long 23ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/commander 21ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/@protobufjs%2fcodegen 27ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/@protobufjs%2ffloat 27ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/@protobufjs%2futf8 26ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/@protobufjs%2ffetch 27ms (cache hit)
npm http fetch GET 200 https://registry.npmjs.org/quickselect 24ms (cache hit)

added 37 packages in 913ms
npm verb exit 0
npm info ok 

Since the new file (Source/Scene/VRPose.js) is not present in the upstream, the export stated in node_modules/cesium/Source/Cesium.js:705 is invalid.

Fix

The fix would be that the @cesium/widgets and @cesium/engine modules were manually installed using tgz packages as well.

This travis/release.sh does the job:

#!/bin/bash
set -ev

if [ $TRAVIS_BRANCH == "cesium.com" ]; then
  npm --silent run website-release
else
  npm --silent run make-zip
  npm pack . ./packages/* &> /dev/null
fi

npm --silent run build-apps

if [ $TRAVIS_BRANCH != "cesium.com" ]; then
  # verify prod package
  mkdir ../test
  cp cesium-*.tgz ../test
  cp Specs/test.*js ../test
  cd ../test
  npm install cesium-*.tgz
  NODE_ENV=development node test.cjs
  NODE_ENV=production node test.cjs
  node test.mjs
fi
@pupitetris pupitetris changed the title Travis "Linting, Deployment" script always for PR with new js files Travis CI - Pull Request: Linting, Deployment job always fails for PR with new js files Jul 30, 2023
@ggetz
Copy link
Contributor

ggetz commented Jul 31, 2023

See #11441 for a fix.

I added a fix for this as part of a larger PR. I should have split that into its own PR initially.

@pupitetris
Copy link
Author

Ah, I see. Totally the best way to do it. I keep learning, since I'm (also) new at node-based development.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants