-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Jakub Stejskal <[email protected]>
- Loading branch information
Showing
12 changed files
with
309 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
.idea | ||
**/target | ||
.DS_Store | ||
*.iml | ||
docs/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<packaging>jar</packaging> | ||
<artifactId>dummy-module</artifactId> | ||
<version>0.0.4-SNAPSHOT</version> | ||
|
||
<parent> | ||
<groupId>io.skodjob</groupId> | ||
<artifactId>test-generator</artifactId> | ||
<version>0.0.4-SNAPSHOT</version> | ||
</parent> | ||
|
||
<licenses> | ||
<license> | ||
<name>The Apache License, Version 2.0</name> | ||
<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url> | ||
</license> | ||
</licenses> | ||
|
||
<name>${project.groupId}:${project.artifactId}</name> | ||
<description>Dummy module</description> | ||
<url>https://github.com/skodjob/test-metadata-generator</url> | ||
|
||
<scm> | ||
<connection>scm:git:git:/github.com/skodjob/test-metadata-generator.git</connection> | ||
<developerConnection>scm:git:ssh://github.com/skodjob/test-metadata-generator.git</developerConnection> | ||
<url>https://github.com/skodjob/test-metadata-generator</url> | ||
</scm> | ||
|
||
<issueManagement> | ||
<system>GitHub</system> | ||
<url>https://github.com/skodjob/test-metadata-generator/issues</url> | ||
</issueManagement> | ||
|
||
<developers> | ||
<developer> | ||
<id>im-konge</id> | ||
<name>Lukáš Král</name> | ||
<email>[email protected]</email> | ||
</developer> | ||
<developer> | ||
<id>kornys</id> | ||
<name>David Kornel</name> | ||
<email>[email protected]</email> | ||
</developer> | ||
<developer> | ||
<id>Frawless</id> | ||
<name>Jakub Stejskal</name> | ||
<email>[email protected]</email> | ||
</developer> | ||
</developers> | ||
|
||
<properties> | ||
<maven.compiler.source>17</maven.compiler.source> | ||
<maven.compiler.target>17</maven.compiler.target> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
|
||
<!-- Skip publishing of this module --> | ||
<maven.deploy.skip>true</maven.deploy.skip> | ||
<generator.version>0.0.4-SNAPSHOT</generator.version> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>io.skodjob</groupId> | ||
<artifactId>test-docs-generator-maven-plugin</artifactId> | ||
<version>${generator.version}</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<artifactId>maven-dependency-plugin</artifactId> | ||
<executions> | ||
<execution> | ||
<phase>generate-sources</phase> | ||
<goals> | ||
<goal>copy-dependencies</goal> | ||
</goals> | ||
<configuration> | ||
<outputDirectory>${project.build.directory}/lib</outputDirectory> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>io.skodjob</groupId> | ||
<artifactId>test-docs-generator-maven-plugin</artifactId> | ||
<version>${generator.version}</version> | ||
<executions> | ||
<execution> | ||
<phase>post-integration-test</phase> | ||
<goals> | ||
<goal>test-docs-generator</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
<configuration> | ||
<filePath>./dummy-module/src/test/java/io/</filePath> | ||
<generatePath>./docs/</generatePath> | ||
<generateFmf>true</generateFmf> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<artifactId>exec-maven-plugin</artifactId> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<executions> | ||
<execution> | ||
<id>Check generated data</id> | ||
<phase>post-integration-test</phase> | ||
<goals> | ||
<goal>exec</goal> | ||
</goals> | ||
<configuration> | ||
<executable>${basedir}/../scripts/check-docs.sh</executable> | ||
<arguments> | ||
<argument>dummy-module</argument> | ||
</arguments> | ||
</configuration> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
|
||
</plugins> | ||
</build> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
/* | ||
* Copyright Skodjob authors. | ||
* License: Apache License 2.0 (see the file LICENSE or http://apache.org/licenses/LICENSE-2.0.html). | ||
*/ | ||
package io.skodjob; | ||
|
||
import io.skodjob.annotations.Contact; | ||
import io.skodjob.annotations.Desc; | ||
import io.skodjob.annotations.Step; | ||
import io.skodjob.annotations.SuiteDoc; | ||
import io.skodjob.annotations.TestDoc; | ||
import io.skodjob.annotations.TestTag; | ||
import io.skodjob.annotations.UseCase; | ||
@SuiteDoc( | ||
description = @Desc("My test suite containing various tests"), | ||
beforeTestSteps = { | ||
@Step(value = "Deploy uber operator across all namespaces, with custom configuration", expected = "Uber operator is deployed"), | ||
@Step(value = "Deploy management Pod for accessing all other Pods", expected = "Management Pod is deployed") | ||
}, | ||
afterTestSteps = { | ||
@Step(value = "Delete management Pod", expected = "Management Pod is deleted"), | ||
@Step(value = "Delete uber operator", expected = "Uber operator is deleted") | ||
}, | ||
useCases = { | ||
@UseCase(id = "core") | ||
}, | ||
tags = { | ||
@TestTag(value = "regression"), | ||
@TestTag(value = "clients") | ||
} | ||
) | ||
public class DummyTest { | ||
|
||
@TestDoc( | ||
description = @Desc("Test checking that the application works as expected"), | ||
steps = { | ||
@Step(value = "Create object instance", expected = "Instance of an object is created"), | ||
@Step(value = "Do a magic trick", expected = "Magic trick is done with success"), | ||
@Step(value = "Clean up the test case", expected = "Everything is cleared") | ||
}, | ||
useCases = { | ||
@UseCase(id = "core") | ||
}, | ||
tags = { | ||
@TestTag(value = "default") | ||
} | ||
) | ||
void testMethodOne() { | ||
|
||
} | ||
|
||
@TestDoc( | ||
description = @Desc("Test checking that the application works as expected. " + | ||
"This is just a little bit longer line, nothing else."), | ||
contact = @Contact(name = "Jakub Stejskal", email = "[email protected]"), | ||
steps = { | ||
@Step(value = "Create object instance", expected = "Instance of an object is created"), | ||
@Step(value = "Do a magic trick", expected = "Magic trick is done with success"), | ||
@Step(value = "Clean up the test case", expected = "Everything is cleared"), | ||
@Step(value = "Do a magic cleanup check", expected = "Everything magically work") | ||
}, | ||
useCases = { | ||
@UseCase(id = "core"), | ||
@UseCase(id = "core+"), | ||
@UseCase(id = "core+++") | ||
} | ||
) | ||
void testMethodTwo() { | ||
|
||
} | ||
|
||
@TestDoc( | ||
description = @Desc("Test checking that the application works as expected. " + | ||
"This is just a little bit longer line, nothing else."), | ||
contact = @Contact(name = "Jakub Stejskal", email = "[email protected]") | ||
) | ||
void testMethodThree() { | ||
|
||
} | ||
|
||
@TestDoc( | ||
description = @Desc("Test checking that the application works as expected. " + | ||
"This is just a little bit longer line, nothing else."), | ||
contact = @Contact(name = "Jakub Stejskal", email = "[email protected]"), | ||
tags = { | ||
@TestTag(value = "default"), | ||
@TestTag(value = "regression"), | ||
} | ||
) | ||
void testMethodFour() { | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env bash | ||
|
||
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)" | ||
|
||
fmf_output="${DIR}/../docs/io/skodjob/DummyTest.fmf" | ||
fmf_expected="${DIR}/../test-docs-generator-maven-plugin/src/test/resources/expected-docs.fmf" | ||
|
||
md_output="${DIR}/../docs/io/skodjob/DummyTest.md" | ||
md_expected="${DIR}/../test-docs-generator-maven-plugin/src/test/resources/expected-docs.md" | ||
|
||
if cmp -s "$fmf_output" "$fmf_expected"; then | ||
echo "The files \"$fmf_output\" and \"$fmf_expected\" are the same." | ||
else | ||
echo "The files \"$fmf_output\" and \"$fmf_expected\" are different." | ||
diff "$fmf_output" "$fmf_expected" | ||
exit 1 | ||
fi | ||
|
||
if cmp -s "$md_output" "$md_expected"; then | ||
echo "The files \"$md_output\" and \"$md_expected\" are the same." | ||
else | ||
echo "The files \"$md_output\" and \"$md_expected\" are different." | ||
diff "$md_output" "$md_expected" | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.