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

Jonahstanley/acceptance tests unique database #298

Merged
merged 10 commits into from
Jul 10, 2013

Conversation

JonahStanley
Copy link
Contributor

Suggested Reviewers: @jzoldak @wedaly
Acceptance tests now pull from their own database/collection
These are destroyed at the end of each scenario

_CONTENTSTORE.clear()
modulestore = xmodule.modulestore.django.modulestore()
modulestore.collection.drop()
xmodule.modulestore.django._MODULESTORES.clear()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These lines need comments. Specifically, why are we dropping the database in one case (the content store) but dropping collections in the other (the module store)?

@jzoldak
Copy link
Contributor

jzoldak commented Jul 1, 2013

@JonahStanley the modulestore collection is not being cleared out after the last test is run. To verify:
from mongo

use test_xmodule
db.dropDatabase()

run the tests, then from mongo

use test_xmodule
show collections

4 collections are created by running rake test_acceptance_lms.

JonahStanley added 8 commits July 9, 2013 08:54
These databases/collections are cleared after harvest
This might allow parallel features in the future
This is to allow acceptance tests to properly link and know the names of its other parts
Acceptance_static is used to prevent collect static from using a seed
test.py had its seed removed due to redundancy
@@ -80,7 +80,7 @@ TEST_TASK_DIRS = []

# Run acceptance tests
desc "Run acceptance tests"
task "test_acceptance_#{system}", [:harvest_args] => [:clean_test_files, "#{system}:gather_assets:acceptance", "fasttest_acceptance_#{system}"]
task "test_acceptance_#{system}", [:harvest_args] => [:clean_test_files, "#{system}:gather_assets:acceptance_static", "fasttest_acceptance_#{system}"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add in a comment explaining why we did this, so that we remember and other people know why too.

This explains why acceptance_static is used
"""
This config file extends the test environment configuration
so that we can run the lettuce acceptance tests.
"""
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Explain why we need to do this. Something like that we want the same settings as acceptance.py except for the db or collection names, because otherwise any call to django-admin (including collectstatic) will create another uniquely named one.

@jzoldak
Copy link
Contributor

jzoldak commented Jul 10, 2013

👍

JonahStanley pushed a commit that referenced this pull request Jul 10, 2013
…-database

Jonahstanley/acceptance tests unique database
@JonahStanley JonahStanley merged commit 786f422 into master Jul 10, 2013
@JonahStanley JonahStanley deleted the jonahstanley/acceptance-tests-unique-database branch July 10, 2013 21:09
e-kolpakov referenced this pull request in open-craft/edx-platform Nov 3, 2014
…roficiency-avg

ziafazal/api-fix-company-proficiency-avg: fix for incorrect average calculation
CrewS pushed a commit to CrewS/edx-platform-1 that referenced this pull request Feb 18, 2019
Sujeet1379 pushed a commit to chandrudev/edx-platform that referenced this pull request Nov 17, 2022
* Commits:
  Run coverage via Github Action
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.

3 participants