-
-
Notifications
You must be signed in to change notification settings - Fork 390
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
test: added compiler test to verify IDE2's build path calculation is in sync with the CLI #1823
Conversation
a679e8f
to
1da8f6d
Compare
b1ef801
to
3f87af7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can do this:
- Make fresh clone of
arduino/arduino-ide
repo. - Run
yarn
in the repo. - Run
yarn test:slow
The tests run as expected.
But if I do the rest of the steps to run the application before attempting to run the tests:
- Make fresh clone of
arduino/arduino-ide
repo. - Run
yarn
in the repo. - Run
yarn test:slow
- Run
yarn yarn rebuild:browser
- Run
yarn rebuild:electron
- Run
yarn test:slow
Then it fails:
$ yarn test:slow
yarn run v1.22.19
$ lerna run test:slow
lerna notice cli v6.1.0
lerna info versioning independent
> arduino-ide-extension:"test:slow"
$ mocha "./lib/test/**/*.slow-test.js"
arduino-ide-extension: Error: Module did not self-register: '/mnt/1c0bd221-e077-452c-b688-160dc700c122/git/arduino-ide/node_modules/drivelist/build/Release/drivelist.node'.
arduino-ide-extension: at Object.Module._extensions..node (node:internal/modules/cjs/loader:1249:18)
arduino-ide-extension: at Module.load (node:internal/modules/cjs/loader:1043:32)
arduino-ide-extension: at Function.Module._load (node:internal/modules/cjs/loader:878:12)
arduino-ide-extension: at Module.require (node:internal/modules/cjs/loader:1067:19)
arduino-ide-extension: at require (node:internal/modules/cjs/helpers:103:18)
arduino-ide-extension: at bindings (/mnt/1c0bd221-e077-452c-b688-160dc700c122/git/arduino-ide/node_modules/bindings/bindings.js:112:48)
arduino-ide-extension: at Object.<anonymous> (/mnt/1c0bd221-e077-452c-b688-160dc700c122/git/arduino-ide/node_modules/drivelist/js/index.js:25:27)
arduino-ide-extension: at Module._compile (node:internal/modules/cjs/loader:1165:14)
arduino-ide-extension: at Object.Module._extensions..js (node:internal/modules/cjs/loader:1219:10)
arduino-ide-extension: at Module.load (node:internal/modules/cjs/loader:1043:32)
arduino-ide-extension: at Function.Module._load (node:internal/modules/cjs/loader:878:12)
arduino-ide-extension: at Module.require (node:internal/modules/cjs/loader:1067:19)
arduino-ide-extension: at require (node:internal/modules/cjs/helpers:103:18)
arduino-ide-extension: at Object.<anonymous> (/mnt/1c0bd221-e077-452c-b688-160dc700c122/git/arduino-ide/node_modules/@theia/core/lib/node/env-variables/env-variables-server.js:31:19)
arduino-ide-extension: at Module._compile (node:internal/modules/cjs/loader:1165:14)
arduino-ide-extension: at Object.Module._extensions..js (node:internal/modules/cjs/loader:1219:10)
arduino-ide-extension: at Module.load (node:internal/modules/cjs/loader:1043:32)
arduino-ide-extension: at Function.Module._load (node:internal/modules/cjs/loader:878:12)
arduino-ide-extension: at Module.require (node:internal/modules/cjs/loader:1067:19)
arduino-ide-extension: at require (node:internal/modules/cjs/helpers:103:18)
arduino-ide-extension: at Object.<anonymous> (/mnt/1c0bd221-e077-452c-b688-160dc700c122/git/arduino-ide/arduino-ide-extension/lib/node/theia/env-variables/env-variables-server.js:15:32)
arduino-ide-extension: at Module._compile (node:internal/modules/cjs/loader:1165:14)
arduino-ide-extension: at Object.Module._extensions..js (node:internal/modules/cjs/loader:1219:10)
arduino-ide-extension: at Module.load (node:internal/modules/cjs/loader:1043:32)
arduino-ide-extension: at Function.Module._load (node:internal/modules/cjs/loader:878:12)
arduino-ide-extension: at Module.require (node:internal/modules/cjs/loader:1067:19)
arduino-ide-extension: at require (node:internal/modules/cjs/helpers:103:18)
arduino-ide-extension: at Object.<anonymous> (/mnt/1c0bd221-e077-452c-b688-160dc700c122/git/arduino-ide/arduino-ide-extension/lib/test/node/core-service-impl.slow-test.js:34:32)
arduino-ide-extension: at Module._compile (node:internal/modules/cjs/loader:1165:14)
arduino-ide-extension: at Object.Module._extensions..js (node:internal/modules/cjs/loader:1219:10)
arduino-ide-extension: at Module.load (node:internal/modules/cjs/loader:1043:32)
arduino-ide-extension: at Function.Module._load (node:internal/modules/cjs/loader:878:12)
arduino-ide-extension: at Module.require (node:internal/modules/cjs/loader:1067:19)
arduino-ide-extension: at require (node:internal/modules/cjs/helpers:103:18)
arduino-ide-extension: at requireOrImport (/mnt/1c0bd221-e077-452c-b688-160dc700c122/git/arduino-ide/node_modules/mocha/lib/esm-utils.js:15:12)
arduino-ide-extension: at Object.exports.loadFilesAsync (/mnt/1c0bd221-e077-452c-b688-160dc700c122/git/arduino-ide/node_modules/mocha/lib/esm-utils.js:28:26)
arduino-ide-extension: at Mocha.loadFilesAsync (/mnt/1c0bd221-e077-452c-b688-160dc700c122/git/arduino-ide/node_modules/mocha/lib/mocha.js:386:19)
arduino-ide-extension: at singleRun (/mnt/1c0bd221-e077-452c-b688-160dc700c122/git/arduino-ide/node_modules/mocha/lib/cli/run-helpers.js:149:15)
arduino-ide-extension: at exports.runMocha (/mnt/1c0bd221-e077-452c-b688-160dc700c122/git/arduino-ide/node_modules/mocha/lib/cli/run-helpers.js:186:11)
arduino-ide-extension: at Object.exports.handler (/mnt/1c0bd221-e077-452c-b688-160dc700c122/git/arduino-ide/node_modules/mocha/lib/cli/run.js:319:11)
arduino-ide-extension: at /mnt/1c0bd221-e077-452c-b688-160dc700c122/git/arduino-ide/node_modules/mocha/node_modules/yargs/lib/command.js:241:49
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
> Lerna (powered by Nx) Running target "arduino-ide-extension:test:slow" failed
Failed tasks:
- arduino-ide-extension:test:slow
Hint: run the command with --verbose for more details.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
This problem happens on my Windows 11 and my Ubuntu 22.04 machines (I didn't check on macOS).
Am I doing something silly @kittaakos?
Great that you have asked! It's expected. The tests should execute again if you switch back to the "browser" (Node.js from your
Click for full output
Explanation: Any Theia application comes with native node dependencies. These dependencies are not downloaded from anywhere but built on the When you run When you give users an electron-based app, such as IDE2, users might not have Node.js installed and available from the {
"node": "16.5.0",
"v8": "9.4.146.22-electron.0",
"uv": "1.41.0",
"zlib": "1.2.11",
"brotli": "1.0.9",
"ares": "1.17.1",
"modules": "98",
"nghttp2": "1.42.0",
"napi": "8",
"llhttp": "6.0.2",
"openssl": "1.1.1",
"icu": "69.1",
"unicode": "13.0",
"electron": "15.5.7",
"chrome": "94.0.4606.81"
} The
After the FAQ:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks so much for the excellent explanation Akos.
This test is great because we would be unlikely to catch a regression via manual testing.
Signed-off-by: Akos Kitta <a.kitta@arduino.cc>
3f87af7
to
34cdc61
Compare
## Depends on #1809✅Motivation
IDE2 wants to provide better UX when debugging an uncompiled sketch (#808). IDE2 must detect erroneous CLI behavior and provide user-friendly actions to achieve this. Currently, it's not trivial to detect the cause of an error (arduino/arduino-cli#1762, arduino/arduino-cli#1968 (comment)) so IDE2 tries to rely on filesystem path detected in the error messages. When the CLI compiles a sketch, it puts the build output into the temp folder. IDE2 tries to guess these temp folder paths from the location of the sketches on the filesystem. Sometimes, there is no deterministic way to determine the temp build output path. There are situations when it's only a guess. See here: #1809 (review). This PR enables compiler tests using the gRPC client to make sure the IDE2 build output path calculation behaves the same as the CLI's.
Change description
ready
deferred promise from the core client provider. It broke the test, and it turned out to be not used. This PR cleans it up.yarn test
) and slow tests (yarn test:slow
). For example, slow tests do not run when checking internationalization on the CI. (Ideally, no tests were executed on internationalization checks, but it's a different story.) Slow tests must use the*.slow-test.ts
glob.Other information
Reviewer checklist