Skip to content

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

Merged
azatsarynnyy merged 1 commit into
mainfrom
tests-deps
May 16, 2023
Merged

azatsarynnyy merged 1 commit into
mainfrom
tests-deps

Conversation

@azatsarynnyy

@azatsarynnyy azatsarynnyy commented May 15, 2023 •

Copy link
Copy Markdown
Member

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

github-actions Bot commented May 15, 2023 •

Copy link
Copy Markdown
Contributor

Click here to review and test in web IDE: Contribute

@github-actions

Copy link
Copy Markdown
Contributor

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

RomanNikitenko commented May 15, 2023 •

Copy link
Copy Markdown
Collaborator

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
Copy Markdown
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
@azatsarynnyy
azatsarynnyy deleted the tests-deps branch May 16, 2023 15:03
@ghost

ghost commented May 16, 2023

Copy link
Copy Markdown

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

@ghost

ghost commented May 16, 2023

Copy link
Copy Markdown

@RomanNikitenko

RomanNikitenko commented May 17, 2023 •

Copy link
Copy Markdown
Collaborator

@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
Copy Markdown
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

Development

Successfully merging this pull request may close these issues.

2 participants