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

Functional test and analytics in Performance test task #305

Merged
merged 1 commit into from
Jan 19, 2023
Merged
Show file tree
Hide file tree
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 @@ -1401,6 +1401,21 @@ public void shouldGenerateJarWithSpecificName() {
.exists());
}

@Test
public void canRunTaskGeneratePerformanceTest() {
canRunTaskGenerateStructureWithOutParameters();
String task = "generatePerformanceTest";
String valuePerformanceType = "JMETER";

runner.withArguments(task, TYPE + valuePerformanceType);
runner.withProjectDir(projectDir);
BuildResult result = runner.build();

assertTrue(new File("build/functionalTest/performance-test/README.md").exists());

assertEquals(result.task(":" + task).getOutcome(), TaskOutcome.SUCCESS);
}

private void writeString(File file, String string) throws IOException {
try (Writer writer = new FileWriter(file)) {
writer.write(string);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ public List<PerformanceTestType> getTypes() {

@TaskAction
public void generateAcceptanceTestTask() throws CleanException, IOException {
long start = System.currentTimeMillis();
if (type == null) {
printHelp();
throw new IllegalArgumentException(
Expand All @@ -40,5 +41,6 @@ public void generateAcceptanceTestTask() throws CleanException, IOException {

moduleFactory.buildModule(builder);
builder.persist();
sendAnalytics(type.name(), System.currentTimeMillis() - start);
}
}