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

Fix gradle plugin build #16984

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,18 @@ public void notUpToDateWhenExecutedTwiceWithFixedTimeAndChangedProjectVersion()
}

@TestTemplate
public void reproducibleOutputWithFixedTime() throws InvalidRunnerConfigurationException,
UnexpectedBuildFailure, IOException, InterruptedException {
public void reproducibleOutputWithFixedTime()
throws InvalidRunnerConfigurationException, UnexpectedBuildFailure,
IOException, InterruptedException {
assertThat(this.gradleBuild.build("buildInfo", "-PnullTime").task(":buildInfo")
.getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
File buildInfoProperties = new File(this.gradleBuild.getProjectDir(),
"build/build-info.properties");
String firstHash = FileUtils.sha1Hash(buildInfoProperties);
assertThat(buildInfoProperties.delete()).isTrue();
Thread.sleep(1500);
assertThat(this.gradleBuild.build("buildInfo", "-PnullTime")
.task(":buildInfo").getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
assertThat(this.gradleBuild.build("buildInfo", "-PnullTime").task(":buildInfo")
.getOutcome()).isEqualTo(TaskOutcome.SUCCESS);
String secondHash = FileUtils.sha1Hash(buildInfoProperties);
assertThat(firstHash).isEqualTo(secondHash);
}
Expand Down