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

Support alternate rails environment names for tests #665

Merged
merged 1 commit into from
Oct 29, 2018

Conversation

justindoody
Copy link
Contributor

Changes

Switches to using db:purge over db:test:purge.

db:purge:

desc "Empty the database from DATABASE_URL or config/database.yml for the current RAILS_ENV (use db:purge:all to purge all databases in the config). Without RAILS_ENV it defaults to purging the development and test databases."

db:test:purge hardcodes loading configuration for an environment named test. db:purge will load the environment for whatever RAILS_ENV is set to (or fallback).

Here within parallel_tests purge_before_load is used on lines that support passing through alternate env's (RAILS_ENV=#{ParallelTests::Tasks.rails_env}).

Usecase

I'm trying to run parallel_tests in it's own rails environment i'm naming parallel_test -- this is so I can specify a few custom environment options directly for parallel runs and so i can run one of tests against a separate environment (and db config) while my parallel test suite is running.

This should be backwards compatible while expanding flexibility.

Other

Wasn't sure how you are handling versioning so did a patch level bump.

@grosser
Copy link
Owner

grosser commented Oct 29, 2018

sounds good ... drop does about the same, so if the logic did not work people would have already complained :)

@grosser grosser merged commit 50567e6 into grosser:master Oct 29, 2018
@grosser
Copy link
Owner

grosser commented Oct 29, 2018

v2.26.2

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.

None yet

2 participants