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

Refactor specs that fail under the parallel tests gem #665

Closed
kreek opened this issue Jul 24, 2019 · 2 comments
Closed

Refactor specs that fail under the parallel tests gem #665

kreek opened this issue Jul 24, 2019 · 2 comments

Comments

@kreek
Copy link
Contributor

kreek commented Jul 24, 2019

User Story

As a developer I want all specs to pass using the parallel tests gem so that the TDD development cycle is faster.

Acceptance Criteria

Some rspec examples in the following specs fail under the parallel tests gem:

Detail

spec/controllers/v0/vic/profile_photo_attachments_controller_spec.rb
spec/jobs/transactional_email_analytics_job_spec.rb
spec/jobs/vic/submission_job_spec.rb
spec/jobs/vic/submission_job_spec.rb
spec/lib/vic/service_spec.rb
spec/request/preneeds/burial_forms_request_spec.rb
spec/request/swagger_spec.rb
spec/uploaders/evss_claim_document_uploader_spec.rb

The specs share state and need to refactored so they're properly set up and torn down and the sprint. They share in common either creating/deleting files or running background jobs. One fix was to wrap a test helper with a mutex.syncronize so that access to files is locked per thread. Other tests probably do to much in that they are more integration tests than unit tests and we should mock and stub behavior not directly related to the subject's behavior.

@annaswims
Copy link
Contributor

parallel tests gem draft pr here department-of-veterans-affairs/vets-api#3169

@annaswims
Copy link
Contributor

This is becoming more of a time suck than we anticipated. There is a bug in parallel_tests that I was eventually able to overcome documented here grosser/parallel_tests#718. Also, there is more than one bug in simplecov The first one is fixed in this PR simplecov-ruby/simplecov#746 and the second one has not been researched, but the coverage results are incorrect (too low). I suspect that something in this commit may be part of the issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants