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

Replace mocha --opts approach #15627

Closed
Katka92 opened this issue Jan 8, 2020 · 7 comments
Closed

Replace mocha --opts approach #15627

Katka92 opened this issue Jan 8, 2020 · 7 comments
Labels
area/qe kind/task Internal things, technical debt, and to-do tasks to be performed. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Milestone

Comments

@Katka92
Copy link
Contributor

Katka92 commented Jan 8, 2020

Is your task related to a problem? Please describe.

According to the official mocha page, the mocha --opts are going to be deprecated [1]. We should consider changing that approach. When choosing the right way it should be taken into account having some parametrized approach to run test suites.
Currently, if we want to have a new test suite, we need to create a new script in scripts part in package.json file and corresponding mocha-<something>.opts file with the definition. We plan to have a lot of tests for devfiles (default ones and getting-started ones) so using that approach there will be a lot of files in the root and a package.json will grow quite large.
The chosen approach should be easily adoptable by downstream.

[1] https://mochajs.org/#-opts-path

Describe the solution you'd like

There are several ways we can achieve that.

  1. Use --config .mocharc.js instead of --opts
    Documentation: https://mochajs.org/#-config-path
    The --config in mocha allows to dynamically compose the structure that was saved in mocha.opts. Having that we can dynamically change parameters and test suites. Basically there will be file mocharc.js with all the logic. [2]

  2. Use "parent" test suite class that will combine specified tests
    This approach would require having all test suites exported e.g. as a function. Then the "parent" test suite file can execute only specified ones.

  3. Using the environment variables
    We can specify some environment variable that would contain a specific test(s) that should be executed. In package.json there would be just one script working with this parameter and generating suite that would be executed. (Can be done also with --config e.g. using .mocharc.json [3]).

[2] https://github.com/mochajs/mocha/blob/master/example/config/.mocharc.js
[3] https://github.com/mochajs/mocha/blob/master/example/config/.mocharc.json

Describe alternatives you've considered

There can be also other alternatives - those can be also discussed during the investigation part of that issue.

@Katka92 Katka92 added kind/task Internal things, technical debt, and to-do tasks to be performed. team/che-qe labels Jan 8, 2020
@Katka92 Katka92 added this to the Backlog - QE milestone Jan 8, 2020
@rhopp rhopp added the area/qe label May 11, 2020
@Katka92
Copy link
Contributor Author

Katka92 commented May 22, 2020

I've noticed that we are getting the warning in upstream test image:

(node:146) DeprecationWarning: Configuration via mocha.opts is DEPRECATED and will be removed from a future version of Mocha. Use RC files or package.json instead.

@che-bot
Copy link
Contributor

che-bot commented Jan 4, 2021

Issues go stale after 180 days of inactivity. lifecycle/stale issues rot after an additional 7 days of inactivity and eventually close.

Mark the issue as fresh with /remove-lifecycle stale in a new comment.

If this issue is safe to close now please do so.

Moderators: Add lifecycle/frozen label to avoid stale mode.

@che-bot che-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 4, 2021
@Katka92
Copy link
Contributor Author

Katka92 commented Jan 4, 2021

/remove-lifecycle stale

@Katka92
Copy link
Contributor Author

Katka92 commented Jan 4, 2021

I think the issue was still not solved, so I'm leaving it open.

@che-bot che-bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 4, 2021
@che-bot
Copy link
Contributor

che-bot commented Jul 19, 2021

Issues go stale after 180 days of inactivity. lifecycle/stale issues rot after an additional 7 days of inactivity and eventually close.

Mark the issue as fresh with /remove-lifecycle stale in a new comment.

If this issue is safe to close now please do so.

Moderators: Add lifecycle/frozen label to avoid stale mode.

@che-bot che-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 19, 2021
@Katka92
Copy link
Contributor Author

Katka92 commented Jul 19, 2021

/remove-lifecycle stale

@che-bot che-bot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jul 19, 2021
@che-bot che-bot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 15, 2022
@che-bot
Copy link
Contributor

che-bot commented Jan 15, 2022

Issues go stale after 180 days of inactivity. lifecycle/stale issues rot after an additional 7 days of inactivity and eventually close.

Mark the issue as fresh with /remove-lifecycle stale in a new comment.

If this issue is safe to close now please do so.

Moderators: Add lifecycle/frozen label to avoid stale mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/qe kind/task Internal things, technical debt, and to-do tasks to be performed. lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale.
Projects
None yet
Development

No branches or pull requests

3 participants