lib/datadog/ci/test.rb in datadog-ci-1.0.0.beta2 vs lib/datadog/ci/test.rb in datadog-ci-1.0.0.beta3
- old
+ new
@@ -67,9 +67,27 @@
# @return [Boolean] true if the test is skipped by the intelligent test runner, false otherwise.
def skipped_by_itr?
get_tag(Ext::Test::TAG_ITR_SKIPPED_BY_ITR) == "true"
end
+ # Marks this test as unskippable by the intelligent test runner.
+ # This must be done before the test execution starts.
+ #
+ # Examples of tests that should be unskippable:
+ # - tests that read files from disk
+ # - tests that make network requests
+ # - tests that call external processes
+ # - tests that use forking or threading
+ #
+ # @return [void]
+ def itr_unskippable!
+ set_tag(Ext::Test::TAG_ITR_UNSKIPPABLE, "true")
+ if skipped_by_itr?
+ clear_tag(Ext::Test::TAG_ITR_SKIPPED_BY_ITR)
+ set_tag(Ext::Test::TAG_ITR_FORCED_RUN, "true")
+ end
+ end
+
# Sets the status of the span to "pass".
# @return [void]
def passed!
super