Skip to content

Commit

Permalink
Publish report entry
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolai Parlog committed May 28, 2022
1 parent dc2f726 commit 60dcb87
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/disabled-until.adoc
Expand Up @@ -15,6 +15,7 @@ The test will be automatically executed again once the date supplied by the `dat

WARNING: Applying `@DisabledUntil` can make the test suite non-reproducible.
If a failing test is disabled during a build that then passes, rerunning that build after the "until" date would fail.
A report entry is issued for every test that is disabled until a certain date.

== Usage

Expand Down
Expand Up @@ -62,6 +62,8 @@ private ConditionEvaluationResult evaluateUntilDate(ExtensionContext context, Lo
boolean disabled = today.isBefore(untilDate);

if (disabled) {
String reportEntry = format("This test is disabled until %s. If executing it on this commit would fail, the build can't be reproduced after that date.", untilDate.format(ISO_8601));
context.publishReportEntry("DisabledUntil", reportEntry);
String message = format("The `date` %s is after the current date %s", untilDate.format(ISO_8601),
today.format(ISO_8601));
return disabled(message);
Expand Down

0 comments on commit 60dcb87

Please sign in to comment.