Skip to content

Commit

Permalink
[ST] Add CollectorElement to the NamespaceManager for situations when…
Browse files Browse the repository at this point in the history
… we are creating Namespaces manually (#10780)

Signed-off-by: Lukas Kral <[email protected]>
  • Loading branch information
im-konge authored Oct 31, 2024
1 parent 5250a51 commit 1961072
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,18 @@ public void createNamespaceAndAddToSet(String namespaceName, CollectorElement co
}

/**
* Overloads {@link #createNamespaceAndPrepare(String, CollectorElement)} - with {@code CollectorElement} set to {@code null},
* so the Namespace will not be added into the {@link #MAP_WITH_SUITE_NAMESPACES}.
* Overloads {@link #createNamespaceAndPrepare(String, CollectorElement)}, but it creates a new {@link CollectorElement} for
* test class and test method automatically. The {@link CollectorElement} is needed for {@link io.strimzi.systemtest.logs.TestLogCollector} to
* correctly collect logs from all the Namespaces -> even those that are created manually in the test cases.
*
* @param namespaceName name of Namespace that should be created
*/
public void createNamespaceAndPrepare(String namespaceName) {
createNamespaceAndPrepare(namespaceName, null);
final String testSuiteName = ResourceManager.getTestContext().getRequiredTestClass().getName();
final String testCaseName = ResourceManager.getTestContext().getTestMethod().orElse(null) == null ?
"" : ResourceManager.getTestContext().getRequiredTestMethod().getName();

createNamespaceAndPrepare(namespaceName, new CollectorElement(testSuiteName, testCaseName));
}

/**
Expand Down

0 comments on commit 1961072

Please sign in to comment.