-
Notifications
You must be signed in to change notification settings - Fork 1
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
Implemented unit test in build #30
Conversation
harmen-xb
commented
Oct 29, 2023
•
edited
Loading
edited
- Refactored github workflows to only workflow files (no actions) and include build, test and lint (including test report).
- Refactored all tsconfig files to re-use base config and all sub-folder tsconfigs to be composite.
- Fixed error in debug launch settings so debug-mode is set correctly.
- Upgraded jest dependencies to latest version.
- Refactored all jest configs to have local configs which re-use generic config.
- Performed yarn update
- Setup wokspace jest config which references to all projects.
- Updated gitpod config.
- Added VSCode Dev Container config.
Removed jest dependencies from root package.json. Moved jest-config to extentensions/crossmodel-lang for now.
…and aligned with Theia Blueprint.
Updated workflow to pickup the jest xml.
Changed jest config to write in the root, i.s.o. out directory. Changed scan path for publishing test results.
Updated publish test result files path.
Performed yarn upgrade.
Remove coverage report.
Refactored tsconfig to all extend the base tsconfig and have specific one in the root of the workspace.
As part of this PR for unit tests in the build I did some extra things which I want to check with you:
|
Added model-server test from another branch.
pdated package.json in root to execute jest directly, i.s.o. via lerna per package.
…which is OS dependent).
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.
Thank you very much for that change, @harmen-xb! Having the tests properly execute will help us a lot down the road!
As for your questions:
- I'm not sure I fully follow you. Are you saying after moving some of the dependencies from the root package.json to other package.json files, the yarn.lock did not get updated properly? I would need to check up on this but I would not have expected this. Did you do a
yarn
oryarn install
? Of course, you can do ayarn upgrade
but I would be careful about it as it upgrades a lot of packages so it is better to maybe specify the particular package you want to upgrade. - No, I think using
Node
for module resolution should be absolutely fine. I think we switched toNode16
as GLSP had that setting. But unless we need any specific features such as async imports it is definitely good idea to stay aligned with Theia. - The configuration looks good to me so thank you for fixing that! I really wouldn't expect any side effects if the linting is properly applied on all our files.
- You are completely right, linting only does a static code analysis so there shouldn't be anything platform-specific and doing it only on Linux is definitely a good idea. I believe Theia is doing the same.
One minor thing I noticed was that when we run the linting now, we already get 3 warnings:
crossmodel-lang: [...]/crossmodel/extensions/crossmodel-lang/src/language-server/lexer/cross-model-indentation-tokens.ts
crossmodel-lang: 57:1 warning Missing return type on function @typescript-eslint/explicit-function-return-type
crossmodel-lang: ✖ 1 problem (0 errors, 1 warning)
@crossbreeze/model-service: [...]/crossmodel/packages/model-service/src/common/model-service-rpc.ts
@crossbreeze/model-service: 23:39 warning 'JsonRpcServer' is deprecated. since 1.39.0 use `RpcServer` instead deprecation/deprecation
@crossbreeze/model-service: [...]/crossmodel/packages/model-service/src/node/model-service-backend-module.ts
@crossbreeze/model-service: 18:21 warning 'JsonRpcConnectionHandler' is deprecated. since 1.39.0 use `RpcConnectionHandler` instead deprecation/deprecation
@crossbreeze/model-service: ✖ 2 problems (0 errors, 2 warnings)
Should we maybe fix them already or do you want to do this in a separate task?
Unfortunately, through the yarn upgrade
we also did a Theia upgrade from 1.37.2 to 1.42.1 which broke the Electron build. I see the following issue when starting it up:
Error: Cannot find module '../src-gen/frontend/electron-main.js'
Require stack:
- [...]/crossmodel/applications/electron-app/scripts/electron-main.js
- [...]/crossmodel/node_modules/electron/dist/resources/default_app.asar/main.js
I believe this needs to be adapted to lib/frontend/electron-main.js
. I didn't check for any other issues yet, not sure if you want to revert the Theia upgrade and do it separately.
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.
Thank you for the quick update, @harmen-xb! I had another look at it and the tests run through without any issues, all linting errors and warnings are gone and everything still works as expected. Great work!