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

manually shard tests by hibernate/non-hibernate #887

Merged
merged 2 commits into from Apr 1, 2019

Conversation

Projects
None yet
3 participants
@mightyguava
Copy link
Collaborator

commented Apr 1, 2019

Cuts CI time down from ~10min to ~7min https://circleci.com/workflow-run/5732206a-0754-4da1-9a07-cd7e2500de11

I have no idea what I'm doing here in gradle-land. The idea is to have a target that runs all tests for modules that use hibernate, and thus have to spin up mysql/vitess, and another target for all tests that don't, and have the 2 run in parallel.

@mightyguava mightyguava requested review from adrw and wesleyk Apr 1, 2019

@wesleyk

wesleyk approved these changes Apr 1, 2019

@adrw

adrw approved these changes Apr 1, 2019

Copy link
Member

left a comment

Looks like a great 30% improvement!

Might be some other opportunities to use the Circle CI environment variables for parallelism and add that to the job definition as opposed to adding separate jobs. https://circleci.com/docs/2.0/parallelism-faster-jobs/

@mightyguava

This comment has been minimized.

Copy link
Collaborator Author

commented Apr 1, 2019

cool, i can try that

@mightyguava mightyguava force-pushed the yunchi/circleci branch from aa34886 to 51e5ede Apr 1, 2019

@mightyguava mightyguava force-pushed the yunchi/circleci branch from 51e5ede to 5b1e713 Apr 1, 2019

@mightyguava

This comment has been minimized.

Copy link
Collaborator Author

commented Apr 1, 2019

@adrw that worked! Much cleaner

# There's a race condition here, where it's possible that MySQL hasn't finished starting
# up before we try to connect to it. But Kotlin builds are so damn slow it'll never
# happen in practice.
command: docker run -d -p 3306:3306 --name mysql -e MYSQL_ALLOW_EMPTY_PASSWORD=1 mysql:5.7
command: |
# Only run MySQL for the hibernate tests.

This comment has been minimized.

Copy link
@wesleyk

wesleyk Apr 1, 2019

Collaborator

nice!

- run:
name: "Build and test"
command: ./gradlew test -i --scan --parallel --build-cache
command: |
if [ "$CIRCLE_NODE_INDEX" -eq 1 ]; then

This comment has been minimized.

Copy link
@adrw

adrw Apr 1, 2019

Member

Tight!

@mightyguava mightyguava merged commit ae4ed17 into master Apr 1, 2019

4 checks passed

ci/circleci: java Your tests passed on CircleCI!
Details
ci/circleci: node Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@mightyguava mightyguava deleted the yunchi/circleci branch Apr 1, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.