Skip to content

Commit

Permalink
make sure to reset AppSec.settings state after each test to avoid fla…
Browse files Browse the repository at this point in the history
…ky state test results
  • Loading branch information
GustavoCaso committed Feb 23, 2023
1 parent ca6ed3b commit b6f7afe
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
5 changes: 4 additions & 1 deletion spec/datadog/appsec/contrib/rack/integration_test_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,10 @@
end
end

after { Datadog.registry[:rack].reset_configuration! }
after do
Datadog::AppSec.settings.send(:reset!)
Datadog.registry[:rack].reset_configuration!
end

context 'for an application' do
# TODO: also test without Tracing: it should run without trace transport
Expand Down
5 changes: 5 additions & 0 deletions spec/datadog/appsec/contrib/rails/integration_test_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@
end
end

after do
Datadog::AppSec.settings.send(:reset!)
Datadog.registry[:rails].reset_configuration!
end

context 'for an application' do
include_context 'Rails test application'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@
end

after do
Datadog::AppSec.settings.send(:reset!)
Datadog.registry[:rack].reset_configuration!
Datadog.registry[:sinatra].reset_configuration!
end
Expand Down

0 comments on commit b6f7afe

Please sign in to comment.