Skip to content

johthor/feature/54 asciiDocReporter tags - #2211

Merged
l-1squared merged 47 commits into
masterfrom
johthor/feature/54-asciiDocReporter-tags
Oct 9, 2026
Merged

l-1squared merged 47 commits into
masterfrom
johthor/feature/54-asciiDocReporter-tags

Conversation

@hvennekate

Copy link
Copy Markdown
Collaborator

Continuation of #1945

  • Enclose scenarios with AsciiDoc tags
  • Simplify test to ensure both snippets are compatible
  • Add mapping JGiven tags to AsciiDoc tags
  • Collect tagged feature files and scenario counts
  • Write index files only for used tags
  • Replace spaces in tag names
  • Group scenarios by tags
  • Restructure report generator
  • Take the number of failed/pending scenarios into account
  • Fix intro for aborted scenarios and add them to report
  • Fix section intros
  • Cleanup import statements
  • Fix some more grammar errors
  • Reformat
  • Add testMethodName as another AsciiDoc tag around the scenario
  • Convert AsciiDoc plugin tests to JUnit 5
  • Reformat code
  • Add Kate swap files and Eclipse CheckStyle files to .gitignore
  • Fix variable name

These will be used prepare a hierarchical tag overview.

Issue: #54
Signed-off-by: Johannes Thorn <2544827+johthor@users.noreply.github.com>
Issue: #54
Signed-off-by: Johannes Thorn <2544827+johthor@users.noreply.github.com>
Issue: #54
Signed-off-by: Johannes Thorn <2544827+johthor@users.noreply.github.com>
Issue: #54
Signed-off-by: Johannes Thorn <2544827+johthor@users.noreply.github.com>
Issue: #54
Signed-off-by: Johannes Thorn <2544827+johthor@users.noreply.github.com>
Issue: #54
Signed-off-by: Johannes Thorn <2544827+johthor@users.noreply.github.com>
Issue: #54
Signed-off-by: Johannes Thorn <2544827+johthor@users.noreply.github.com>
Issue: #54
Signed-off-by: Johannes Thorn <2544827+johthor@users.noreply.github.com>
Signed-off-by: Johannes Thorn <2544827+johthor@users.noreply.github.com>

# Conflicts:
#	jgiven-core/src/main/java/com/tngtech/jgiven/report/asciidoc/AsciiDocReportGenerator.java
Signed-off-by: Johannes Thorn <2544827+johthor@users.noreply.github.com>
Signed-off-by: Johannes Thorn <2544827+johthor@users.noreply.github.com>
Signed-off-by: Johannes Thorn <2544827+johthor@users.noreply.github.com>
Signed-off-by: Johannes Thorn <2544827+johthor@users.noreply.github.com>

# 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 <2544827+johthor@users.noreply.github.com>
Also reformat

Signed-off-by: Johannes Thorn <2544827+johthor@users.noreply.github.com>
Signed-off-by: Johannes Thorn <2544827+johthor@users.noreply.github.com>
Also optimize some tag prefixes to improve the understanding.

Issue: #54
Signed-off-by: Johannes Thorn <2544827+johthor@users.noreply.github.com>
Signed-off-by: Hendrik Vennekate <Hendrik.Vennekate@tngtech.com>
@hvennekate
hvennekate force-pushed the johthor/feature/54-asciiDocReporter-tags branch from 5b343e2 to 3d56500 Compare June 12, 2026 15:38
Signed-off-by: Hendrik Vennekate <Hendrik.Vennekate@tngtech.com>
Signed-off-by: Hendrik Vennekate <Hendrik.Vennekate@tngtech.com>
Signed-off-by: Hendrik Vennekate <Hendrik.Vennekate@tngtech.com>
Signed-off-by: Hendrik Vennekate <Hendrik.Vennekate@tngtech.com>
Signed-off-by: Hendrik Vennekate <Hendrik.Vennekate@tngtech.com>
Signed-off-by: Hendrik Vennekate <Hendrik.Vennekate@tngtech.com>
Signed-off-by: Hendrik Vennekate <Hendrik.Vennekate@tngtech.com>
Signed-off-by: Hendrik Vennekate <Hendrik.Vennekate@tngtech.com>
@hvennekate
hvennekate force-pushed the johthor/feature/54-asciiDocReporter-tags branch from d9716ad to ab02137 Compare June 12, 2026 15:53
Comment thread .gitignore
Comment thread jgiven-asciidoc-report/build.gradle.kts Outdated
implementation(libs.guava)
implementation(libs.slf4j.api)
implementation(project(":jgiven-core"))
testImplementation(platform(libs.junit6.bom))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

remind me to place a bundle that if we merge before the injection error

@hvennekate hvennekate Jul 24, 2026 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Will add TODO

@@ -298,38 +295,38 @@ public void convert_step_with_multiline_argument_and_data_table() {
////

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I guess this can go too

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Why, though, actually? I had it removed earlier, but looking back at it before committing: Why not split into nested classes?

*/
final class AsciiDocSnippetGenerator {
private static final String LINE_BREAK = System.lineSeparator();
private static final String LEVEL_OFFSET = ":leveloffset:";

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

that would be a leveloffset indicator, woudnt it?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Seems to be called an "attribute": https://asciidoc-py.github.io/userguide.html

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LEVEL_OFFSET_ATTRIBUTE_NAME seems lengthy

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

? It's just LEVEL_OFFSET_ATTRIBUTE...

// Report title is provided via report config.
:toc: left
:toclevels: 3
:toclevels: 2

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

a style choice, I presume?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Presumably @johthor looked at a lot of reports and got tired of too many levels in TOC, I suppose.

In order to make it more evident what collections of `String` really are

Signed-off-by: Hendrik Vennekate <Hendrik.Vennekate@tngtech.com>
@hvennekate
hvennekate force-pushed the johthor/feature/54-asciiDocReporter-tags branch from a39c29b to 3ae53c5 Compare August 14, 2026 13:22
Signed-off-by: Hendrik Vennekate <Hendrik.Vennekate@tngtech.com>
Signed-off-by: Hendrik Vennekate <Hendrik.Vennekate@tngtech.com>
Signed-off-by: Hendrik Vennekate <Hendrik.Vennekate@tngtech.com>
… of ID

Signed-off-by: Hendrik Vennekate <Hendrik.Vennekate@tngtech.com>
Signed-off-by: Hendrik Vennekate <Hendrik.Vennekate@tngtech.com>
@hvennekate
hvennekate force-pushed the johthor/feature/54-asciiDocReporter-tags branch from f80de01 to 49b54c3 Compare August 28, 2026 13:18
Comment thread jgiven-core/src/main/java/com/tngtech/jgiven/report/model/Tag.java Outdated
private GsonHolder() {
}

public static Gson get() {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Ideally, we could also do this using a LazyInitializer. I was not sure what the position of pulling additional dependencies was (here: Apache Commons).

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Generally speaking, though, GSON should only be initialized once, I believe.

import static com.google.gson.internal.GsonTypes.newParameterizedTypeWithOwner;

public class GsonHolder {
private static final class ClassTypeAdapter extends TypeAdapter<Class<?>> {

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This is the controversial part: GSON does not per default allow for (de-)serializing Java classes for security reasons.
It stands to reason that there is little potential for harm here as we are limiting it to annotations and this mechanism is mainly used for writing and reading reports (unless I missed some aspects).

@hvennekate
hvennekate force-pushed the johthor/feature/54-asciiDocReporter-tags branch from b7a4b9a to 68782d0 Compare August 28, 2026 15:13
Signed-off-by: Hendrik Vennekate <Hendrik.Vennekate@tngtech.com>
Signed-off-by: Hendrik Vennekate <Hendrik.Vennekate@tngtech.com>
Signed-off-by: Hendrik Vennekate <Hendrik.Vennekate@tngtech.com>
Signed-off-by: Hendrik Vennekate <Hendrik.Vennekate@tngtech.com>
Signed-off-by: Hendrik Vennekate <Hendrik.Vennekate@tngtech.com>
Signed-off-by: Hendrik Vennekate <Hendrik.Vennekate@tngtech.com>
Signed-off-by: Hendrik Vennekate <Hendrik.Vennekate@tngtech.com>
Signed-off-by: Hendrik Vennekate <Hendrik.Vennekate@tngtech.com>
Comment thread jgiven-core/src/main/java/com/tngtech/jgiven/report/model/Tag.java
Comment thread jgiven-core/src/main/java/com/tngtech/jgiven/report/AbstractReportGenerator.java Outdated
@l-1squared l-1squared mentioned this pull request Oct 9, 2026
Signed-off-by: Hendrik Vennekate <Hendrik.Vennekate@tngtech.com>
@l-1squared
l-1squared merged commit 914c210 into master Oct 9, 2026
55 checks passed
@l-1squared
l-1squared deleted the johthor/feature/54-asciiDocReporter-tags branch October 9, 2026 13:04
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