-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
ci(test): migrate test cmd #8138
Conversation
force fireworm resolution
Code Coverage Summary
|
1 similar comment
Code Coverage Summary
|
@@ -77,10 +75,12 @@ | |||
"commander": "^9.1.0", | |||
"deep-object-diff": "^1.1.7", | |||
"eslint": "^8.21.0", | |||
"fireworm": "^0.7.2", |
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.
fixes testem ci
error
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.
but what is it?
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.
the error?
or the package?
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 forgot what was the error...
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.
no this package. How does it fix n error?
Code Coverage Summary
|
Code Coverage Summary
|
Code Coverage Summary
|
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.
should I remove old-travis-reference.yml
?
Code Coverage Summary
|
Code Coverage Summary
|
Code Coverage Summary
|
Code Coverage Summary
|
Code Coverage Summary
|
Code Coverage Summary
|
1 similar comment
Code Coverage Summary
|
Code Coverage Summary
|
I would like the .fabric folder with test_results to be only test_results. I'm also trying to move the coverage report under the same command but it doesn't seem to work |
@@ -53,6 +53,8 @@ | |||
"export": "node ./scripts website export", | |||
"build-tests": "rollup -c ./rollup.test.config.js", | |||
"test": "node ./scripts test", | |||
"test:unit-browser": "npm run test -- -s unit -p 8080 -l -c ", | |||
"test:visual-browser": "npm run test -- -s visual -p 8080 -l -c ", |
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.
-c
flag is already taken
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.
make it --coverage
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.
this is the -c flag to append chrome/firefox is not the coverage flag
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.
so -c chrome,firefox
I tried that and didn't get it to work |
.addOption(new commander.Option('-c, --context <context...>', 'context to test in').choices(['chrome', 'firefox', 'node']).default(['chrome', 'node'])) | ||
.option('-p, --port') | ||
.option('-o, --out <out>', 'path to report test results to') | ||
.option('--clear-cache', 'clear CLI test cache', false) |
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.
You should add the option --coverage
here
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.
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.
karma has it....
https://www.npmjs.com/package/karma-coverage
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.
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.
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.
yes coverage needs only node, but results are weird in this screenshot.
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.
it's only for activeselection
i wasn't able to move the coverage command, i always get a command that hangs |
1 similar comment
i wasn't able to move the coverage command, i always get a command that hangs |
show you what i did diff --git a/scripts/index.js b/scripts/index.js
index 546e5ec7..e9802a20 100644
--- a/scripts/index.js
+++ b/scripts/index.js
@@ -148,7 +148,7 @@ function startWebsite() {
const args = ['run', 'start:dev'];
// WSL ubuntu
- // https://github.com/microsoft/WSL/issues/216
+ // https://github.com/microsoft/WSL/issues/216
// os.platform() === 'win32' && args.push('--', '--force_polling', '--livereload');
if (os.platform() === 'win32') {
console.log(chalk.green('Consider using ubuntu on WSL to run jekyll with the following options:'));
@@ -272,7 +272,7 @@ async function test(suite, tests, options = {}) {
env: {
...process.env,
TEST_FILES: (tests || []).join(','),
- NODE_CMD: ['qunit', 'test/node_test_setup.js', 'test/lib'].concat(tests || `test/${suite}`).join(' '),
+ NODE_CMD: [...(options.coverage ? ['nyc --silent']: []), 'qunit', 'test/node_test_setup.js', 'test/lib'].concat(tests || `test/${suite}`).join(' '),
VERBOSE: Number(options.verbose),
QUNIT_DEBUG_VISUAL_TESTS: Number(options.debug),
QUNIT_RECREATE_VISUAL_REFS: Number(options.recreate),
@@ -469,6 +469,7 @@ program
.option('-p, --port')
.option('-o, --out <out>', 'path to report test results to')
.option('--clear-cache', 'clear CLI test cache', false)
+ .option('-cov --coverage', 'Add coverage report with nyc', false)
.action((options) => {
if (options.clearCache) {
fs.removeSync(CLI_CACHE);
@@ -538,4 +539,4 @@ program
});
});
-program.parse(process.argv);
\ No newline at end of file
+program.parse(process.argv); i get a twst command that run super slow and make tests fail |
I did something pretty much the same. |
- .option('-cov --coverage', 'Add coverage report with nyc', false)
+ .option('-cov, --coverage', 'Add coverage report with nyc', false)
- ...(options.coverage ? ['nyc --silent']: [])
+ ...options.coverage ? 'nyc --silent': '' |
Code Coverage Summary
|
Code Coverage Summary
|
@@ -77,10 +75,12 @@ | |||
"commander": "^9.1.0", | |||
"deep-object-diff": "^1.1.7", | |||
"eslint": "^8.21.0", | |||
"fireworm": "^0.7.2", |
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.
no this package. How does it fix n error?
Co-authored-by: Andrea Bogazzi <andreabogazzi79@gmail.com>
This PR changes the
test
cmd to usetestem
.This is done so we can stop using
fabricjs.com
for local browser testing and discontinue any associations between the repos.I decided to keep going with
testem
for now.We can always migrate to
karma
if we want to.Later on we can remove the commands of the website...
or should I do that here and now?Should we move allDONEtestem
files totests
? I think it's better order. Their location is used only byscripts/index
Files
workflows
- semantic cmd changescripts/index
- refactor to support testem + put all local cache files in.fabric
foldertest/GoldensServer.js
- extract fromscripts/index
, now runs when testem start visual teststestem*
- adapted config/test page, moved undertest
and refactored fromjson
tojs
test/lib/*
- adapted methodsrollup.test.config.js
- need help here, can't get the tests to build properlyLogging has become silly because the program spawns tests in parallel (node, chrome, firefox) so it logs a mess when
--verbose
option is set. Well actually it is not that bad because ci runs only one context at a time so there will be no parallel logging there. Only locally, so I think it is fine. The-c,--context
option can be used to run a single context. So I can't care less about this. And the test results are dumped to separate files under.fabric
so the dev can view it there nice and orderlyChanges
tests log only errors (exposed
--verbose
flag)renamed
dev
cmd tofabric
What about the rest of the interactive tests on fabricjs.com?
Started another effort migrating benchmarks, will PR in the near future