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

Command line argument --wanted-tags=_ imports all items #432

Open
kaklakariada opened this issue Nov 13, 2024 · 0 comments
Open

Command line argument --wanted-tags=_ imports all items #432

kaklakariada opened this issue Nov 13, 2024 · 0 comments
Labels

Comments

@kaklakariada
Copy link
Contributor

kaklakariada commented Nov 13, 2024

Description

When running OFT with command line argument --wanted-tags=_ it imports all specification items

Steps to Reproduce

  1. Create a spec item a with tag "tagA" and one item b without tags
  2. Run OFT with --wanted-tags=_

Expected behavior

OFT imports only the item b

Environment

  • OFT: 4.1.0

Additional context

Failing test case for TestSpecificationListBuilder reproducing the bug:

    @Test
    void testFilterSpecificationItemsByTagsOnlyWithoutTag()
    {
        final FilterSettings filterSettings = FilterSettings.builder() //
                .tags(emptySet()) //
                .withoutTags(true) //
                .build();
        final SpecificationListBuilder builder = SpecificationListBuilder
                .createWithFilter(filterSettings);
        addItemWithTags(builder, "out-A", "client", "database");
        addItemWithTags(builder, "out-B", "server", "database");
        addItemWithTags(builder, "out-C", "exporter", "database");
        addItemWithTags(builder, "in-D");
        final List<SpecificationItem> items = builder.build();
        assertThat(items.stream().map(SpecificationItem::getName).collect(Collectors.toList()),
                containsInAnyOrder("in-D"));
    }

See also itsallcode/openfasttrace-maven-plugin@f9fbbed (#71)

Workaround

Specify any unused tag, e.g. --wanted-tags=_,unusedTag

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: 📫 Backlog
Development

No branches or pull requests

1 participant