-
Notifications
You must be signed in to change notification settings - Fork 8
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
I60 config discrepancies destroys development data when running specs #753
Conversation
Previously the solr url for test and development would point to the same place. When ActiveFedora::Clean! got called to reset test data, it would also reset development data. This update should correct that. Issue - scientist-softserv#60 (comment)
@orangewolf @aprilrieger I would appreciate a review of this, from a devops perspective. I'm not confident about or totally familiar with the consequences of my changes besides the fact that its no longer destroying my development data when I run a spec 🎉 Also, something weird is still happening. I am able to connect to hyku.test even though it's not listed in the docker-compose file and i should only be using ams.test. This was also the reason why we weren't able to run feature specs locally. |
Switching to Draft. It's ready for review but I don't want anyone to accidentally merge it until devops review. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove stuff unrelated to this fix. the fix looks great though.
In this PR, I compared configurations against working apps like hyku proper and UTK, and took note of the configuration discrepancies.
In particular, we were trying to find the reason why running specs would destroy our local data. Specs should rely on its test environment and its data should be separate from development. Using RAILS_ENV=test didn't make a difference.
For specs there's helper method called #reset! It runs in a before suite hook. Within that method, ActiveFedora::Cleaner.clean! triggered the issue of destroying development data.
With LaRitas help we discovered the issue was actually because of solr using hydra-development for both environments.
Issue:
EOD TODO:
ref: scientist-softserv#60 (comment)
3.times {Asset.create!}
Asset.count
=> 3reload!
;Asset.count
=> hopefully returns the correct count (ie: 3 in this example)UPDATE: Tested ✅
In this screenshot, i created 3 assets in rails console. then in the spec context i ran the offensive line that previously deleted development data, reloaded rails c and asked for the count again. Previously it would return 0 but it appears to be persisting now.