Skip to content

Commit 2ee753a

Browse files
committed
Remove MutsGather from test-frame
Signed-off-by: David Kornel <kornys@outlook.com>
1 parent 9bd8d68 commit 2ee753a

File tree

6 files changed

+0
-288
lines changed

6 files changed

+0
-288
lines changed

test-frame-log-collector/README.md

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -169,43 +169,6 @@ the logs path will then look like this:
169169
```
170170
The tree path will look similarly to above examples, there will be folders for Namespaces matching the specified labels.
171171

172-
### MustGather
173-
`MustGather` is an annotation which can handle collecting logs which user want automatically in case of test failure or before/after failure.
174-
It gets configuration passed into `MustGatherController` and call collecting in proper callbacks.
175-
176-
Register `MustGatherController` handlers and configure
177-
178-
```java
179-
import io.skodjob.testframe.LogCollectorBuilder;
180-
import io.skodjob.testframe.annotations.MustGather;
181-
import io.skodjob.testframe.listeners.MustGatherController;
182-
import io.skodjob.testframe.resources.KubeResourceManager;
183-
import org.junit.jupiter.api.Test;
184-
185-
@MustGather
186-
class TestClass() {
187-
static {
188-
// Setup global log collector and handlers
189-
MustGatherController.setupMustGatherController(new LogCollectorBuilder()
190-
.withNamespacedResources("sa", "deployment", "configmaps", "secret")
191-
.withClusterWideResources("nodes")
192-
.withKubeClient(KubeResourceManager.getKubeClient())
193-
.withKubeCmdClient(KubeResourceManager.getKubeCmdClient())
194-
.withRootFolderPath("/some-path/path/")
195-
.build());
196-
MustGatherController.setMustGatherCallback(() -> {
197-
MustGatherController.getMustGatherController().collectFromNamespaces("test-namespace", "test-namespace-2");
198-
MustGatherController.getMustGatherController().collectClusterWideResources();
199-
});
200-
}
201-
202-
@Test
203-
void test() {
204-
...
205-
}
206-
}
207-
```
208-
209172
### Specifying additional folder path
210173

211174
In case that you would like to collect the logs to additional sub-directories of your root folder, the `LogCollector` contains

test-frame-log-collector/src/main/java/io/skodjob/testframe/annotations/MustGather.java

Lines changed: 0 additions & 29 deletions
This file was deleted.

test-frame-log-collector/src/main/java/io/skodjob/testframe/listeners/MustGatherController.java

Lines changed: 0 additions & 139 deletions
This file was deleted.

test-frame-test-examples/src/test/java/io/skodjob/testframe/test/integration/AbstractIT.java

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@
44
*/
55
package io.skodjob.testframe.test.integration;
66

7-
import io.skodjob.testframe.LogCollectorBuilder;
8-
import io.skodjob.testframe.annotations.MustGather;
9-
import io.skodjob.testframe.listeners.MustGatherController;
10-
import io.skodjob.testframe.test.integration.helpers.GlobalLogCollectorTestHandler;
117
import io.skodjob.testframe.utils.LoggerUtils;
128
import io.skodjob.testframe.annotations.ResourceManager;
139
import io.skodjob.testframe.annotations.TestVisualSeparator;
@@ -16,17 +12,14 @@
1612
import io.skodjob.testframe.resources.NamespaceType;
1713
import io.skodjob.testframe.resources.ServiceAccountType;
1814
import io.skodjob.testframe.utils.KubeUtils;
19-
import org.junit.jupiter.api.extension.ExtendWith;
2015

2116
import java.nio.file.Path;
2217
import java.nio.file.Paths;
2318
import java.time.LocalDateTime;
2419
import java.time.format.DateTimeFormatter;
2520
import java.util.concurrent.atomic.AtomicBoolean;
2621

27-
@ExtendWith(GlobalLogCollectorTestHandler.class) // For testing purpose
2822
@ResourceManager
29-
@MustGather
3023
@TestVisualSeparator
3124
public abstract class AbstractIT {
3225
static AtomicBoolean isCreateHandlerCalled = new AtomicBoolean(false);
@@ -58,19 +51,6 @@ public abstract class AbstractIT {
5851
LoggerUtils.logResource("Deleted", r);
5952
}
6053
});
61-
62-
// Setup global log collector and handlers
63-
MustGatherController.setupMustGatherController(new LogCollectorBuilder()
64-
.withNamespacedResources("sa", "deployment", "configmaps", "secret")
65-
.withClusterWideResources("nodes")
66-
.withKubeClient(KubeResourceManager.getKubeClient())
67-
.withKubeCmdClient(KubeResourceManager.getKubeCmdClient())
68-
.withRootFolderPath(LOG_DIR.toString())
69-
.build());
70-
MustGatherController.setMustGatherCallback(() -> {
71-
MustGatherController.getMustGatherController().collectFromNamespaces("default");
72-
MustGatherController.getMustGatherController().collectClusterWideResources();
73-
});
7454
}
7555

7656
protected String nsName1 = "test";

test-frame-test-examples/src/test/java/io/skodjob/testframe/test/integration/MustGatherControllerIT.java

Lines changed: 0 additions & 27 deletions
This file was deleted.

test-frame-test-examples/src/test/java/io/skodjob/testframe/test/integration/helpers/GlobalLogCollectorTestHandler.java

Lines changed: 0 additions & 36 deletions
This file was deleted.

0 commit comments

Comments
 (0)