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

Framework: Enable Parallel Tests on Circle-CI #3793

Merged
merged 1 commit into from
Mar 7, 2016

Conversation

blowery
Copy link
Contributor

@blowery blowery commented Mar 5, 2016

Part of #3822.

This is an attempt to enable test and lint splitting on CircleCI, to take advantage of parallel test containers.

To really make this work, we need to drop the test configuration variable in the web settings, as that is running in addition to the split tests.

Early returns show that moving to 3 containers would drop overall test time to around 4m. Going to our full 8 containers should drop it to around 2m, even before all the test refactoring.

One problem with going full 8 is that the desktop app shares our container set and it seems to be constantly rebuilding itself, even with no changes to the code.

@blowery blowery added Framework [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Mar 5, 2016
@blowery
Copy link
Contributor Author

blowery commented Mar 5, 2016

Might land #3794 first so we can see the actual benefit to parallel test runs

Took a different approach and don't need #3794 any more.

@blowery
Copy link
Contributor Author

blowery commented Mar 7, 2016

Nice, gotta love a 03:32 4-way build. :)

@blowery blowery changed the title Try parallel tests on circle Framework: Enable Parallel Tests on Circle-CI Mar 7, 2016
- client/**/*.jsx
- server/**/*.js
- server/**/*.jsx
- NODE_ENV=development make build && NODE_ENV=development ./bin/run-tests:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In run-tests we overwrite NODE_ENV. Looking at this line it seems like the intention is to use development env. If that's true, then probably we can also skip creating new test.json file. It could be that I missed something of course, I have never worked with Circle CI before :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This actually gets really confusing. Some Makefile ignore an already set NODE_ENV and reset it to TEST. And run-tests sets it, but doesn't export it or pass it along, so subprocs don't seem to pick it up.

In the current system I think we're actually using the outer node_env just to generate the config file? Would be nice to not have the switcheroo and just use an env of test everywhere.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's get us to another unrelated change we discussed today with @nb. We should at some point take advantage of logic build by @mjangda around config/_shared.json file and extract config setting that are common for all envs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, complete agreement. I was debating doing that here, but copying the dev config was simpler and less prone to introduce crazy things.

@gziolo
Copy link
Member

gziolo commented Mar 7, 2016

03:32 is great improvement comparing to 8:55 we have at the moment! 👍

@gziolo gziolo mentioned this pull request Mar 7, 2016
19 tasks

test:
override:
- ./node_modules/.bin/eslint --quiet:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we worry about the maintainability of splitting this off of the lint Makefile target?

(First time I've noticed mixedindentlint as a dependent target of lint)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no way to pass args to a makefile target (that i'm aware of?), so ... not sure how else to do it. maybe move to a npm run lint which runs eslint and move the makefile to use that?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe move to a npm run lint which runs eslint and move the makefile to use that?

I'm a bit of the opinion this is the direction we should head anyways 😄 (Related: #3520)

Is npm any better about passing arguments to the scripted commands? In my own experiences, I seem to recall this being an issue.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No idea. Can find out.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In ac95127

One odd bit: passing $(JS_FILES) through made the linter bomb. Unsure why.

@blowery blowery self-assigned this Mar 7, 2016
@blowery
Copy link
Contributor Author

blowery commented Mar 7, 2016

OK, now npm run lint just works and is reasonably fast.

@blowery
Copy link
Contributor Author

blowery commented Mar 7, 2016

So, we good? I'd love to land this. @aduth @gziolo

@aduth
Copy link
Contributor

aduth commented Mar 7, 2016

Confirmed npm run lint, make lint, npm test, and make test all exit with failing error code when errors present in linting or testing.

I'm personally still confused on a few bits, specifically around when config/test.json is used and why we're not passing NODE_ENV=test into ./bin/run-tests script, but I think I'm failing to understand how the config is passed through those scripts.

I'll leave it to you to decide whether there's concerns there. Otherwise, this is looking good to go 👍

@blowery
Copy link
Contributor Author

blowery commented Mar 7, 2016

I'm personally still confused on a few bits, specifically around when config/test.json is used and why we're not passing NODE_ENV=test into ./bin/run-tests script, but I think I'm failing to understand how the config is passed through those scripts.

I think now that we have a test.json we can just use NODE_ENV=test and be fine. It didn't work in the past because there was no test config to pull from.

How it was working for the server tests is still a bit of a mystery to me.

@blowery blowery force-pushed the try/parallel-tests-on-circle branch from 01b76bb to 19deaa6 Compare March 7, 2016 18:37
@blowery
Copy link
Contributor Author

blowery commented Mar 7, 2016

OK, happy now. Squashing and landing.

Also enable caching in eslint, rework how we run the linter to make it work from an npm script, and add a test config file.
@blowery blowery force-pushed the try/parallel-tests-on-circle branch from 19deaa6 to 42ebab3 Compare March 7, 2016 18:43
blowery added a commit that referenced this pull request Mar 7, 2016
Framework: Enable Parallel Tests on Circle-CI
@blowery blowery merged commit 46cb461 into master Mar 7, 2016
@blowery blowery deleted the try/parallel-tests-on-circle branch March 7, 2016 18:47
@gziolo gziolo added this to the Framework: Single test runner milestone Mar 9, 2016
@nylen nylen removed the [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. label Mar 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants