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

Add integration tests to project #747

Merged
merged 32 commits into from
Feb 11, 2020
Merged

Add integration tests to project #747

merged 32 commits into from
Feb 11, 2020

Conversation

drwl
Copy link
Collaborator

@drwl drwl commented Feb 1, 2020

Adds integration tests to the project that's able to run in CI across different ruby versions.

  • Adds a Rails 5.2.4.1 app
  • Adds a Rails 6.0.2.1 app

Fixes #733

Used the following command:
`rails new rails_6.0.2.1 --skip-git --skip-sprockets --skip-spring --skip-javascript --skip-turbolinks  --skip-test-unit`

Then `rubocop --auto-gen-config` to ignore rubocop violations.
Ran rails db:migrate
Generated using `rails g model Task content:string count:integer status:boolean`
* Ran the migration for Task model.
* Ran Rubocop to ignore files in Rails app.
@drwl drwl mentioned this pull request Feb 4, 2020
Used the following command:
`rails _5.2.4.1_ new rails_5.2.4.1`

Then I deleted /.git that was auto generated.
Used command:
`bin/rails g model Task content:string count:integer status:boolean`
* Update activerecord constraint to support older Ruby versions
  Active Record 6 only supports Ruby versions >= 2.5. This means that Ruby 2.4 will not be supported. By limiting the Active Record version we'll be able to support Ruby 2.4.

* Move bundle install step into each integration test
@drwl drwl mentioned this pull request Feb 4, 2020
@drwl drwl requested a review from ctran February 4, 2020 19:53
@drwl
Copy link
Collaborator Author

drwl commented Feb 4, 2020

@ctran added if you wanna take a look

@drwl drwl changed the title Add integration test Add integration tests to project Feb 4, 2020
@drwl
Copy link
Collaborator Author

drwl commented Feb 4, 2020

@nard-tech could you take a look and tell me what you think?

@nard-tech
Copy link
Collaborator

nard-tech commented Feb 5, 2020

@drwl
It looks good and there is no problem.
Will you add tests for AnnotateRoutes?

@drwl
Copy link
Collaborator Author

drwl commented Feb 6, 2020

@drwl
It looks good and there is no problem.
Will you add tests for AnnotateRoutes?

Sure will do

* Used `bin/spring binstub --remove --all` to remove spring from app.
* Update Gemfile.lock when removing Spring gem.
In a previous commit, spec/integration/**/* was excluded from Rubocop linter rules.

.rubocop.yml inherits from .rubocop_todo.yml before looking at exclusions defined in .rubocop.yml, so spec/integration/rails* was not being ignored.
A hacky approach to solving these constants polluting the global namespace.
@drwl
Copy link
Collaborator Author

drwl commented Feb 11, 2020

Note for any future visitors, ad4f9ba does something hacky which is to have the constants be uniquely named. The constants defined in the describe block become part of the global namespace.

let statements cannot be used because rspec complains about reading values from let statements in a before(:all) block.

Definitely an area to improve.

@drwl drwl merged commit ec0b3b6 into develop Feb 11, 2020
@drwl drwl deleted the drwl/integration-tests branch February 11, 2020 06:07
vfonic pushed a commit to vfonic/annotate_models that referenced this pull request May 8, 2020
Adds integration tests to the project that's able to run in CI across different ruby versions.

* Adds a Rails 5.2.4.1 app
* Adds a Rails 6.0.2.1 app

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

Successfully merging this pull request may close these issues.

Add integration framework to project
2 participants