-
-
Notifications
You must be signed in to change notification settings - Fork 130
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
Update site updates when exercises change and add wip guard #2009
Conversation
@@ -0,0 +1,40 @@ | |||
require "test_helper" | |||
|
|||
class ConceptExercise::CreateTest < ActiveSupport::TestCase |
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.
class ConceptExercise::CreateTest < ActiveSupport::TestCase | |
class SiteUpdates::ProcessNewExerciseUpdateTest < ActiveSupport::TestCase |
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.
Thanks. I reckon loads of flakey tests happen because of this bug.
refute SiteUpdate.exists? | ||
end | ||
|
||
test "creates if not wip" do |
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.
We could consider adding explicit tests for beta
and active
.
initialize_with :exercise | ||
|
||
def call | ||
if exercise.wip? |
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.
What happens in the unlikely case that a new exercise is created with the deprecated
status?
@ErikSchierboom Thanks. Better? |
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.
Nice!
This moves the guarding and updating into one command.
We currently have a race condition where this happens:
This change means that every time the exercise syncs, the site update is refreshed, not just when it's created.
Closes #2009