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

Remove UseCase and rename TestTag to Label #36

Merged
merged 4 commits into from
Jun 28, 2024
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
39 changes: 13 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@ Plugin itself then parse the data from the annotations and generates `Markdown`
To generate documentation of the test class, you can use the following annotations:

* `@SuiteDoc` - is the main annotation, which consists of all other annotation and should be used right above the method.
It contains three fields - `description`, `steps`, and `usecases`, that are set using other annotations.
It contains three fields - `description`, `steps`, and `labels`, that are set using other annotations.
* `@Desc` - overall description of the test, it can contain anything.
* `@Contact` - contact info with fields `name` and `email`.
* `@Step` - particular step done in a test, contains two fields - `value` that contains the step information, `expected`
is for the expected result of the step.
* `@Usecase` - one of the use-cases that the test is testing.
* `@TestTag` - specific tag for the test class.
* `@Label` - label used for specify area of tests defined within the test class.

Example of how the test can be annotated:
```java
Expand All @@ -38,12 +37,9 @@ Example of how the test can be annotated:
@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")
labels = {
@Label(value = "upgrade"),
@Label(value = "clients")
}
)
public static class DummyTest {
Expand All @@ -56,13 +52,12 @@ Example of how the test can be annotated:
To generate documentation of the test method, you can use the following annotations:

* `@TestDoc` - is the main annotation, which consists all other annotation and should be used right above the method.
It contains three fields - `description`, `steps`, and `usecases`, that are set using other annotations.
It contains three fields - `description`, `steps`, and `labels`, that are set using other annotations.
* `@Desc` - overall description of the test, it can contain anything.
* `@Contact` - contact info with fields `name` and `email`.
* `@Step` - particular step done in a test, contains two fields - `value` that contains the step information, `expected`
is for the expected result of the step.
* `@Usecase` - one of the use-cases that the test is testing.
* `@TestTag` - specific tag for the test class.
* `@Label` - label used for group tests covers similar areas.

Example of how the test can be annotated:
```java
Expand All @@ -75,14 +70,9 @@ Example of how the test can be annotated:
@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+++")
},
tags = {
@TestTag(value = "default"),
@TestTag(value = "regression"),
labels = {
@Label(value = "security"),
@Label(value = "upgrade"),
}
)
void testMyCode(ExtensionContext extensionContext) {
Expand All @@ -103,19 +93,16 @@ testDocBody : testDocAttribute ( ',' testDocAttribute )* ;
testDocAttribute : descriptionAttribute
| contactAttribute
| stepsAttribute
| useCasesAttribute
| tagsAttribute
| labelsAttribute
;

descriptionAttribute : 'description' '=' '@Desc' '(' STRING ')';
contactAttribute : 'contact' '=' '@Contact' '(' contactBody ')';
contactBody : 'name' '=' STRING ',' 'email' '=' STRING;
stepsAttribute : 'steps' '=' '{' step ( ',' step )* '}';
step : '@Step' '(' 'value' '=' STRING ',' 'expected' '=' STRING ')';
useCasesAttribute : 'useCases' '=' '{' useCase ( ',' useCase )* '}';
useCase : '@UseCase' '(' 'id' '=' STRING ')';
tagsAttribute : 'tags' '=' '{' testTag ( ',' testTag )* '}';
testTag : '@TestTag' '(' 'value' '=' STRING ')';
labelsAttribute : 'labels' '=' '{' label ( ',' label )* '}';
label : '@Label' '(' 'value' '=' STRING ')';
```

## Generating the documentation
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Core+
# Default

**Description**: Suspendisse sagittis ultrices augue. Aenean vel massa quis mauris vehicula lacinia. Aliquam id dolor. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed ac dolor sit amet purus malesuada congue. Aenean fermentum risus id tortor. Praesent in mauris eu tortor porttitor accumsan. Aliquam ante. Quisque porta. Duis condimentum augue id magna semper rutrum. Duis ante orci, molestie vitae vehicula venenatis, tincidunt ac pede. Duis risus.

Expand Down
7 changes: 7 additions & 0 deletions docs/actual/option1/labels/regression.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Regression

**Description**: Suspendisse sagittis ultrices augue. Aenean vel massa quis mauris vehicula lacinia. Aliquam id dolor. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed ac dolor sit amet purus malesuada congue. Aenean fermentum risus id tortor. Praesent in mauris eu tortor porttitor accumsan. Aliquam ante. Quisque porta. Duis condimentum augue id magna semper rutrum. Duis ante orci, molestie vitae vehicula venenatis, tincidunt ac pede. Duis risus.

**Details**: Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nullam justo enim, consectetuer nec, ullamcorper ac, vestibulum in, elit. Nullam feugiat, turpis at pulvinar vulputate, erat libero tristique tellus, nec bibendum odio risus sit amet ante. Sed vel lectus. Donec odio tempus molestie, porttitor ut, iaculis quis, sem. Nulla quis diam. Donec quis nibh at felis congue commodo. Etiam sapien elit, consequat eget, tristique non, venenatis quis, ante. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat. Mauris elementum mauris vitae tortor. Praesent id justo in neque elementum ultrices. Vestibulum erat nulla, ullamcorper nec, rutrum non, nonummy ac, erat. Nullam faucibus mi quis velit. Donec iaculis gravida nulla. Etiam sapien elit, consequat eget, tristique non, venenatis quis, ante. Nulla turpis magna, cursus sit amet, suscipit a, interdum id, felis. Curabitur ligula sapien, pulvinar a vestibulum quis, facilisis vel sapien. Integer lacinia.

<!-- generated part -->
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Core
# Default

**Description**: Suspendisse sagittis ultrices augue. Aenean vel massa quis mauris vehicula lacinia. Aliquam id dolor. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed ac dolor sit amet purus malesuada congue. Aenean fermentum risus id tortor. Praesent in mauris eu tortor porttitor accumsan. Aliquam ante. Quisque porta. Duis condimentum augue id magna semper rutrum. Duis ante orci, molestie vitae vehicula venenatis, tincidunt ac pede. Duis risus.

Expand Down
7 changes: 7 additions & 0 deletions docs/actual/option2/labels/regression.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Regression

**Description**: Suspendisse sagittis ultrices augue. Aenean vel massa quis mauris vehicula lacinia. Aliquam id dolor. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed ac dolor sit amet purus malesuada congue. Aenean fermentum risus id tortor. Praesent in mauris eu tortor porttitor accumsan. Aliquam ante. Quisque porta. Duis condimentum augue id magna semper rutrum. Duis ante orci, molestie vitae vehicula venenatis, tincidunt ac pede. Duis risus.

**Details**: Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nullam justo enim, consectetuer nec, ullamcorper ac, vestibulum in, elit. Nullam feugiat, turpis at pulvinar vulputate, erat libero tristique tellus, nec bibendum odio risus sit amet ante. Sed vel lectus. Donec odio tempus molestie, porttitor ut, iaculis quis, sem. Nulla quis diam. Donec quis nibh at felis congue commodo. Etiam sapien elit, consequat eget, tristique non, venenatis quis, ante. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat. Mauris elementum mauris vitae tortor. Praesent id justo in neque elementum ultrices. Vestibulum erat nulla, ullamcorper nec, rutrum non, nonummy ac, erat. Nullam faucibus mi quis velit. Donec iaculis gravida nulla. Etiam sapien elit, consequat eget, tristique non, venenatis quis, ante. Nulla turpis magna, cursus sit amet, suscipit a, interdum id, felis. Curabitur ligula sapien, pulvinar a vestibulum quis, facilisis vel sapien. Integer lacinia.

<!-- generated part -->
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Core+
# Default

**Description**: Suspendisse sagittis ultrices augue. Aenean vel massa quis mauris vehicula lacinia. Aliquam id dolor. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed ac dolor sit amet purus malesuada congue. Aenean fermentum risus id tortor. Praesent in mauris eu tortor porttitor accumsan. Aliquam ante. Quisque porta. Duis condimentum augue id magna semper rutrum. Duis ante orci, molestie vitae vehicula venenatis, tincidunt ac pede. Duis risus.

Expand Down
7 changes: 7 additions & 0 deletions docs/actual/option3/labels/regression.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Regression

**Description**: Suspendisse sagittis ultrices augue. Aenean vel massa quis mauris vehicula lacinia. Aliquam id dolor. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed ac dolor sit amet purus malesuada congue. Aenean fermentum risus id tortor. Praesent in mauris eu tortor porttitor accumsan. Aliquam ante. Quisque porta. Duis condimentum augue id magna semper rutrum. Duis ante orci, molestie vitae vehicula venenatis, tincidunt ac pede. Duis risus.

**Details**: Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nullam justo enim, consectetuer nec, ullamcorper ac, vestibulum in, elit. Nullam feugiat, turpis at pulvinar vulputate, erat libero tristique tellus, nec bibendum odio risus sit amet ante. Sed vel lectus. Donec odio tempus molestie, porttitor ut, iaculis quis, sem. Nulla quis diam. Donec quis nibh at felis congue commodo. Etiam sapien elit, consequat eget, tristique non, venenatis quis, ante. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat. Mauris elementum mauris vitae tortor. Praesent id justo in neque elementum ultrices. Vestibulum erat nulla, ullamcorper nec, rutrum non, nonummy ac, erat. Nullam faucibus mi quis velit. Donec iaculis gravida nulla. Etiam sapien elit, consequat eget, tristique non, venenatis quis, ante. Nulla turpis magna, cursus sit amet, suscipit a, interdum id, felis. Curabitur ligula sapien, pulvinar a vestibulum quis, facilisis vel sapien. Integer lacinia.

<!-- generated part -->
5 changes: 0 additions & 5 deletions docs/actual/option3/usecases/core+.md

This file was deleted.

5 changes: 0 additions & 5 deletions docs/actual/option3/usecases/core.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Core
# Default

**Description**: Suspendisse sagittis ultrices augue. Aenean vel massa quis mauris vehicula lacinia. Aliquam id dolor. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed ac dolor sit amet purus malesuada congue. Aenean fermentum risus id tortor. Praesent in mauris eu tortor porttitor accumsan. Aliquam ante. Quisque porta. Duis condimentum augue id magna semper rutrum. Duis ante orci, molestie vitae vehicula venenatis, tincidunt ac pede. Duis risus.

Expand Down
5 changes: 5 additions & 0 deletions docs/actual/option4/labels/regression.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Regression

**Description**: Suspendisse sagittis ultrices augue. Aenean vel massa quis mauris vehicula lacinia. Aliquam id dolor. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Sed ac dolor sit amet purus malesuada congue. Aenean fermentum risus id tortor. Praesent in mauris eu tortor porttitor accumsan. Aliquam ante. Quisque porta. Duis condimentum augue id magna semper rutrum. Duis ante orci, molestie vitae vehicula venenatis, tincidunt ac pede. Duis risus.

**Details**: Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Nullam justo enim, consectetuer nec, ullamcorper ac, vestibulum in, elit. Nullam feugiat, turpis at pulvinar vulputate, erat libero tristique tellus, nec bibendum odio risus sit amet ante. Sed vel lectus. Donec odio tempus molestie, porttitor ut, iaculis quis, sem. Nulla quis diam. Donec quis nibh at felis congue commodo. Etiam sapien elit, consequat eget, tristique non, venenatis quis, ante. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat. Mauris elementum mauris vitae tortor. Praesent id justo in neque elementum ultrices. Vestibulum erat nulla, ullamcorper nec, rutrum non, nonummy ac, erat. Nullam faucibus mi quis velit. Donec iaculis gravida nulla. Etiam sapien elit, consequat eget, tristique non, venenatis quis, ante. Nulla turpis magna, cursus sit amet, suscipit a, interdum id, felis. Curabitur ligula sapien, pulvinar a vestibulum quis, facilisis vel sapien. Integer lacinia.
5 changes: 0 additions & 5 deletions docs/actual/option4/usecases/core+.md

This file was deleted.

5 changes: 0 additions & 5 deletions docs/actual/option4/usecases/core.md

This file was deleted.

Loading