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

Don't run the tests before the dependencies are actually installed #227

Merged
merged 1 commit into from May 16, 2023

Conversation

azatsarynnyy
Copy link
Member

@azatsarynnyy azatsarynnyy commented May 15, 2023

What does this PR do?

Recently, running the test for the che-commands extensions was bound before the dependencies installation phase.
While it works well when building Che-Code assembly from the root of the project, running the dependencies installation solely for the che-commands extension fails. It's because the script depends on the gulp binary which isn't installed yet.
It affects the downstream build.

After merging this PR, the tests for che-commands extensions can be run the same way as for other extensions - by calling yarn test command, e.g:

"test": "yarn compile && node ./test/index.js"

What issues does this PR fix?

It's needed for https://issues.redhat.com/browse/CRW-3160

How to test this PR?

After running cd code/extensions/che-commands && yarn
the extension's dependencies should be installed successfully, without the error:

$ gulp compile-extension:che-commands
/bin/sh: line 1: gulp: command not found
error Command failed with exit code 127.

@github-actions
Copy link

github-actions bot commented May 15, 2023

Click here to review and test in web IDE: Contribute

@github-actions
Copy link

Pull Request images published ✨
image: quay.io/che-incubator-pull-requests/che-code:pr-227-amd64
Dev image: quay.io/che-incubator-pull-requests/che-code-dev:pr-227-dev-amd64

@RomanNikitenko
Copy link
Contributor

RomanNikitenko commented May 15, 2023

After merging this PR, the tests for che-commands extensions can be run the same way as for other extensions - by calling yarn test command

just for my understanding - when do tests for other extensions run?

  • on the project build step?
  • on the docker build step?
  • on the github actions step?
  • some another step?

FYI: some of them are already broken, so I guess they are never run:

image

@azatsarynnyy
Copy link
Member Author

just for my understanding - when do tests for other extensions run?

I suppose the Che-specific extensions were just ported from Che-Theia as it is. I don't remember someone working on any GitHub Action for running the tests. The only way I know is to run yarn test command manually. That's why my suggestion is to automate that with a GitHub Action.
Thanks for the filed issue eclipse-che/che#22213 @RomanNikitenko!

@azatsarynnyy azatsarynnyy merged commit 9cd7a99 into main May 16, 2023
6 checks passed
@azatsarynnyy azatsarynnyy deleted the tests-deps branch May 16, 2023 15:03
@devstudio-release
Copy link

Build 3.7 :: code_3.x/675: Console, Changes, Git Data

@devstudio-release
Copy link

@RomanNikitenko
Copy link
Contributor

RomanNikitenko commented May 17, 2023

@azatsarynnyy
btw, after merging your PR I still have a problem with the gulp dependency:
image

So, I'm able to provide a change to the extension, but I'm not able to compile only this extension - I have to build all assembly...

@azatsarynnyy
Copy link
Member Author

It fixes the issue of installing the extension's dependencies. In your example, running yarn command finishes successfully now 🎉

I've also never seen the compile scripts (from package.json files) used directly in VS Code 🤷‍♂️
@RomanNikitenko Usually, if I need to compile any single built-in extension of VS Code, I use the compile-extension: gulp task they provide. E.g.: npx gulp compile-extension:che-commands (from the VS Code root, of course):

$ npx gulp compile-extension:che-commands
[11:11:39] Using gulpfile ~/github/che-incubator/che-code/code/gulpfile.js
[11:11:39] Starting 'compile-extension:che-commands'...
[11:11:39] Starting clean-extension-che-commands ...
[11:11:39] Finished clean-extension-che-commands after 5 ms
[11:11:39] Starting compile-extension:che-commands ...
[11:11:39] Starting compilation extensions...
[11:11:41] Finished compilation extensions with 0 errors after 1475 ms
[11:11:41] Finished compile-extension:che-commands after 1737 ms
[11:11:41] Finished 'compile-extension:che-commands' after 1.75 s

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