Skip to content

Commit

Permalink
Readme update + typos fixes (#73)
Browse files Browse the repository at this point in the history
Signed-off-by: David Kornel <[email protected]>
  • Loading branch information
kornys authored May 15, 2024
1 parent 53da5ee commit 489c9ae
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 7 deletions.
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,20 @@ For better clarity regarding the test logs, `TestFrame` library provides ASCII v
### Metrics Collector
The [`MetricsCollector`](test-frame-metrics-collector/MetricsCollector.md) is designed to facilitate the collection of metrics from Kubernetes pods.
It integrates seamlessly with Kubernetes environments to gather and process metrics data efficiently.
For more detailed documentation, see the [MetricsCollector README](test-frame-metrics-collector/MetricsCollector.md).
For more detailed documentation, see the MetricsCollector [README](test-frame-metrics-collector/README.md).

### Utils
`TestFrame` contains also tweaks and utils for better working with kubernetes cluster.

## Usage
1. Include dependency to your maven test project
### Include dependency to your maven test project
```xml
<dependency>
<groupId>io.skodjob</groupId>
<artifactId>test-frame-common</artifactId>
</dependency>
```
2. Use annotations for working with `KubeResourceManager` or other provided functionality
### Use annotations for working with `KubeResourceManager` or other provided functionality
```java
//...
@ResourceManager
Expand All @@ -47,7 +47,7 @@ class Test {
}
//...
```
3. To disable `KubeResourceManager` clean resources functionality
### To disable `KubeResourceManager` clean resources functionality
```java
//...
@ResourceManager(cleanResources = false)
Expand All @@ -57,7 +57,7 @@ class Test {
}
//...
```
4. Work with `KubeResourceManager` and clients
### Work with `KubeResourceManager` and clients
```java
//...
@ResourceManager
Expand All @@ -71,6 +71,14 @@ class Test {
}
//...
```
### Register `ResourceType` or `NamespacedResoruceType` classes into `KubeResoruceManager`
```java
KubeResourceManager.getInstance().setResourceTypes(
new NamespaceResource(),
new JobResource(),
new NetworkPolicyResource()
);
```

## Examples
Examples are stored in [test-frame-test](test-frame-test/src/test/java/io/skodjob/testframe/test/integration) module.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ public final class KubeClientIT extends AbstractIT {

@Test
void testCreateResourcesFromYaml() throws IOException {
List<HasMetadata> resoruces = KubeResourceManager.getKubeClient()
List<HasMetadata> resources = KubeResourceManager.getKubeClient()
.readResourcesFromFile(getClass().getClassLoader().getResourceAsStream("resources.yaml"));

KubeResourceManager.getInstance().createResourceWithWait(resoruces.toArray(new HasMetadata[0]));
KubeResourceManager.getInstance().createResourceWithWait(resources.toArray(new HasMetadata[0]));

assertNotNull(KubeResourceManager.getKubeClient().getClient().namespaces().withName(nsName4).get());
assertNotNull(KubeResourceManager.getKubeClient().getClient().serviceAccounts()
Expand Down

0 comments on commit 489c9ae

Please sign in to comment.