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

Improve spec speed #537

Merged
merged 4 commits into from Mar 17, 2016

Conversation

Projects
None yet
3 participants
@petems
Copy link
Member

petems commented Mar 17, 2016

Removes large fixture file, even for non 1.9.3 …

  • The test is to make sure that json is used
  • The size of the json is irrelevant really, just that the right library is used and the json is parsed.
  • Speeds up test suite a gobsmacking amount with parallel tests (~10 mins -> 1 minute)

Adds parallel tests rake task …

Comparison on an 8 core Mac:

$ bundle exec rake parallel_spec
746 examples, 0 failures, 10 pendings

Took 93 seconds (1:33)

Vs Vanilla spec:

$ bundle exec rake spec
Finished in 3 minutes 4.8 seconds (files took 2.14 seconds to load)
746 examples, 0 failures, 10 pending

Changes travis to use parallel specs

Lets speed up that CI!

Removes large fixture file, even for non 1.9.3
* The test is to make sure that json is used
* The size of the json is irrelevant really, just that the right library is used and the json is parsed.
* Speeds up test suite a gobsmacking amount with parallel tests (~10 mins -> 1 minute)
Rakefile Outdated
task :parallel_spec do
require 'parallel_tests/cli'
Rake::Task[:spec_prep].invoke
ParallelTests::CLI.new.run('--type test -t rspec spec/classes spec/defines spec/unit'.split)

This comment has been minimized.

@petems

petems Mar 17, 2016

Author Member

Damn just realised I forgot functions, I did think the speed increase was a little too impressive...

EDIT: nvm, functions is only 2 tests, this is speedy 🚗

This comment has been minimized.

@petems

petems Mar 17, 2016

Author Member

nvm, there's only 2 specs in there, this thing really is fast! 💯

@jenkinsadmin

This comment has been minimized.

Copy link

jenkinsadmin commented Mar 17, 2016

Thank you for this pull request! Please check this document for how the Jenkins project handles pull requests.

@petems petems force-pushed the petems:improve_spec_speed branch 2 times, most recently from e0f3082 to 7906cd4 Mar 17, 2016

@petems

This comment has been minimized.

Copy link
Member Author

petems commented Mar 17, 2016

Note: Repeated running on a dev machine make this faster: ParallelTests::RSpec::RuntimeLogger sorts tests into profiled chunks, decreasing running time 👍

petems added some commits Mar 16, 2016

Adds parallel_tests rake task
Also moves parallel_tests out of development group so it's installed on travis

Comparison on an 8 core Mac:

```
$ bundle exec rake parallel_spec
746 examples, 0 failures, 10 pendings

Took 66 seconds (1:06)
```

Vs.

```
$ bundle exec rake spec
Finished in 3 minutes 4.8 seconds (files took 2.14 seconds to load)
746 examples, 0 failures, 10 pending
```

@petems petems force-pushed the petems:improve_spec_speed branch from 7906cd4 to 2301f95 Mar 17, 2016

@petems

This comment has been minimized.

Copy link
Member Author

petems commented Mar 17, 2016

Consistant 2 mins ~ specs in Travis 🎆

@rtyler

This comment has been minimized.

Copy link
Contributor

rtyler commented Mar 17, 2016

Travis doesn't like you @petems

Please use --help for a listing of valid options
invalid option: --random (defined in ENV['SPEC_OPTS'])

@petems petems force-pushed the petems:improve_spec_speed branch from e589cd4 to 69e2bb2 Mar 17, 2016

@petems

This comment has been minimized.

Copy link
Member Author

petems commented Mar 17, 2016

Whoops, should be fixed now! 😓

rtyler added a commit that referenced this pull request Mar 17, 2016

@rtyler rtyler merged commit 5d02d92 into voxpupuli:master Mar 17, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@rtyler

This comment has been minimized.

Copy link
Contributor

rtyler commented Mar 17, 2016

WHOOO

@rtyler rtyler added this to the 1.7.0 - Oddjob milestone Mar 17, 2016

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.