Skip to content

Conversation

@johthor
Copy link
Contributor

@johthor johthor commented May 18, 2025

Create index files for all used JGiven tags.

These pages distinguish between single-valued and multi-valued tags.

These will be used prepare a hierarchical tag overview.

Issue: TNG#54
Signed-off-by: Johannes Thorn <[email protected]>
Issue: TNG#54
Signed-off-by: Johannes Thorn <[email protected]>
Issue: TNG#54
Signed-off-by: Johannes Thorn <[email protected]>
Issue: TNG#54
Signed-off-by: Johannes Thorn <[email protected]>
Issue: TNG#54
Signed-off-by: Johannes Thorn <[email protected]>
Signed-off-by: Johannes Thorn <[email protected]>

# Conflicts:
#	jgiven-core/src/main/java/com/tngtech/jgiven/report/asciidoc/AsciiDocReportGenerator.java
@hvennekate
Copy link
Collaborator

Moinmoin! Many thanks -- in the meantime, I had already opened #1940 to extract the generator into a module of its own... let me check how we can combine the two.

@hvennekate
Copy link
Collaborator

Hi @johthor ! Would you mind rebasing this onto #1940 ? One key point was to move the generator into its own module. (Sorry for causing more trouble here 😬 )

johthor added 6 commits July 11, 2025 22:43
Signed-off-by: Johannes Thorn <[email protected]>
Signed-off-by: Johannes Thorn <[email protected]>

# Conflicts:
#	jgiven-asciidoc-report/src/main/java/com/tngtech/jgiven/report/asciidoc/AsciiDocReportGenerator.java
#	jgiven-asciidoc-report/src/main/java/com/tngtech/jgiven/report/asciidoc/HierarchyCalculator.java
#	jgiven-asciidoc-report/src/test/java/com/tngtech/jgiven/report/asciidoc/AsciiDocIntroSnippetGeneratorTest.java
Signed-off-by: Johannes Thorn <[email protected]>
Also reformat

Signed-off-by: Johannes Thorn <[email protected]>
Signed-off-by: Johannes Thorn <[email protected]>
Also optimize some tag prefixes to improve the understanding.

Issue: TNG#54
Signed-off-by: Johannes Thorn <[email protected]>
@johthor johthor force-pushed the feature/54-asciiDocReporter-tags branch from fcf4be9 to 1866f6a Compare October 5, 2025 22:09
@johthor
Copy link
Contributor Author

johthor commented Oct 9, 2025

Hey @hvennekate, I had tried to rebase these commits onto #1940 but it got to confusing for me to finish it.

Now after the extraction has been merged I have merged the current master into this branch and adjusted the code where necessary.

I believe that everything is now working as expected.

At a later date I might still add the tag hierarchy tree as it is shown in the HTML report.

@johthor johthor marked this pull request as ready for review October 9, 2025 07:43
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

@RunWith(Parameterized.class)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have JUnit5 tests?

Copy link
Collaborator

@l-1squared l-1squared left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Output looks fine
but for some reason the report says "There are 999 tagged scenarios" when no test was executed

}

static String toAsciiDocTagStart(ExecutionStatus executionStatus) {
public static String toAsciiDocStartTag(final String scenarioName) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks eerily similar to what the TagMapper does. is that intended?

this.allTags = allTags;
}

Map<String, Map<String, List<String>>> computeGroupedTag() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we potentially return something that is easier to decypher?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also isn't the groupoing files by their Tag (but then why the double map?)
so would groupScenarioFilesByTag not be a better name?

tagNames.add(mkTag("Best Tag"));
final long nineMilliseconds = 10_000_000L;
List<Tag> tags = List.of(mkTag("BestTag"));
long nineMilliseconds = 10_000_000L;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why does nine millis start with 10?

@Test
public void convert_scenario_footer_with_multiple_tags() {
// given
List<Tag> tags = List.of(mkTag("BestTag"), mkTag("OtherTag"), mkTag("NicestTag"));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"OtherTag" must be really intimidated by it fabulous company :D

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't this, of all things, have some tests?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants