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

Added development.md #121

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
110 changes: 110 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
# hydrophone

This document describes the process for running hydrophone on your local machine.

## Getting Started
### Prerequisites
- [Go](https://go.dev/dl/)
- [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git)
- [Kind](https://kind.sigs.k8s.io/docs/user/quick-start/#installation)

### Build

```
$ make build
go build -o bin/hydrophone main.go
```

### Install

```
go install sigs.k8s.io/hydrophone@latest
```

### Command line options

```
$ bin/hydrophone --help
Usage of bin/hydrophone:
-busybox-image string
specify an alternate busybox container image. (default "registry.k8s.io/e2e-test-images/busybox:1.36.1-1")
-cleanup
cleanup resources (pods, namespaces etc).
-conformance
run conformance tests.
-conformance-image string
specify a conformance container image of your choice. (default "registry.k8s.io/conformance:v1.29.0")
-dry-run
run in dry run mode.
-focus string
focus runs a specific e2e test. e.g. - sig-auth. allows regular expressions.
-kubeconfig string
path to the kubeconfig file.
-list-images
list all images that will be used during conformance tests.
-output-dir string
directory for logs. (defaults to current directory)
-parallel int
number of parallel threads in test framework. (default 1)
-skip string
skip specific tests. allows regular expressions.
-test-repo string
alternate registry for test images
-test-repo-list string
yaml file to override registries for test images
-verbosity int
verbosity of test framework. (default 4)
```

### Run

Ensure there is a `KUBECONFIG` environment variable specified or `$HOME/.kube/config` file present before running `hydrophone` Alternatively, you can specify the path to the kubeconfig file with the `--kubeconfig` option.

To run conformance tests use:

```
bin/hydrophone --conformance
```

To run a specific test use:

```
bin/hydrophone --focus 'Simple pod should contain last line of the log'
```

To specify a version of conformance image use:

```
bin/hydrophone --conformance-image 'registry.k8s.io/conformance:v1.29.0'
```


## Cleanup

Delete the pod

```
kubectl delete -n conformance pods/e2e-conformance-test
```

Delete the namespace

```
kubectl delete -n conformance pods/e2e-conformance-test && kubectl delete ns conformance
```


### Troubleshooting

Check if the pod is running:

```
kubectl get pods -n conformance
```

use `kubectl logs` or `kubectl exec` to see what is happening in the pod.

NaveenGokavarapu19 marked this conversation as resolved.
Show resolved Hide resolved




Comment on lines +106 to +110
Copy link
Member

@rakshitgondwal rakshitgondwal Feb 1, 2024

Choose a reason for hiding this comment

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

These extra lines need to be deleted at the end.

88 changes: 0 additions & 88 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,94 +19,6 @@ namespace, waits for it to finish and then prints out the results.
- **Extensive Test Development**: Focus is on running existing tests, not developing new ones.
- **Broad Tool Integration**: Limited integration with third-party tools; maintains simplicity.

## Build

```
$ make build
go build -o bin/hydrophone main.go
```

## Install

```
go install sigs.k8s.io/hydrophone@latest
```

## Command line options

```
$ bin/hydrophone --help
Hydrophone is a lightweight runner for kubernetes tests.

Usage:
hydrophone [flags]

Flags:
--busybox-image string specify an alternate busybox container image. (default "registry.k8s.io/e2e-test-images/busybox:1.36.1-1")
--cleanup cleanup resources (pods, namespaces etc).
--config string Default config file.
--conformance run conformance tests.
--conformance-image string specify a conformance container image of your choice. (default "registry.k8s.io/conformance:v1.29.1")
--dry-run run in dry run mode.
--extra-args strings Additional parameters to be provided to the conformance container. These parameters should be specified as key-value pairs, separated by commas. Each parameter should start with -- (e.g., --clean-start=true,--allowed-not-ready-nodes=2)
--focus string focus runs a specific e2e test. e.g. - sig-auth. allows regular expressions.
-h, --help help for hydrophone
--kubeconfig string path to the kubeconfig file.
--list-images list all images that will be used during conformance tests.
--namespace string the namespace where the conformance pod is created. (default "conformance")
--output-dir string directory for logs. (defaults to current directory)
--parallel int number of parallel threads in test framework. (default 1)
--skip string skip specific tests. allows regular expressions.
--test-repo string skip specific tests. allows regular expressions.
--test-repo-list string yaml file to override registries for test images.
--verbosity int verbosity of test framework. (default 4)
```

## Run

Ensure there is a `KUBECONFIG` environment variable specified or `$HOME/.kube/config` file present before running `hydrophone` Alternatively, you can specify the path to the kubeconfig file with the `--kubeconfig` option.

To run conformance tests use:

```
bin/hydrophone --conformance
```

To run a specific test use:

```
bin/hydrophone --focus 'Simple pod should contain last line of the log'
```

To specify a version of conformance image use:

```
bin/hydrophone --conformance-image 'registry.k8s.io/conformance:v1.29.1'
```

## Troubleshooting

Check if the pod is running:

```
kubectl get pods -n conformance
```

use `kubectl logs` or `kubectl exec` to see what is happening in the pod.

## Cleanup

Delete the pod

```
kubectl delete -n conformance pods/e2e-conformance-test
```

Delete the namespace

```
kubectl delete -n conformance pods/e2e-conformance-test && kubectl delete ns conformance
```

## Community

Expand Down