synchronization-testsuites
The main purpose of this repo is build the necessary tooling to collect necessary synchronization-related data logs from a running OpenShift cluster. This data will then be leveraged by different analysis tools to determine if the cluster is running within acceptable bounds synchronization-wise.```
The core approach taken is to strongly encourage and enforce separation of concerns between:
- Declarative description of the cluster(s) under test
- Configuration of a test (e.g. number of repetitions, acceptable thresholds, etc.)
- Collectors - methods of collecting indicative information about the cluster
- Checks - performed on collected values
Setup
- Install Go
- Install dependencies with
go mod tidy
- Install dev binaries:
make install-tools
. Ensure your $GOBIN
is on your $PATH
- yamllint
- Install yamllint with
sudo yum install yamllint
- run with
yamllint ./
- golangci-lint
- Install golangci-lint
- run with
make lint
- license-eye
- Install license-eye with
go install github.com/apache/skywalking-eyes/cmd/license-eye@latest
- run with
license-eye header check
or license-eye header fix
- pre-commit
- on RHEL,
pre-commit
requires recompiling python to include optional sqlite modules:
sudo yum install sqlite-devel
- See instructions here
- install pre-commit with
pip3.10 install pre-commit
- configure your repository to run pre-commit hooks with
pre-commit install
- manually run against all files with
pre-commit run --all-files
or against staged files with pre-commit run
.
- Otherwise pre-commit will now run automatically when you make a new commit.
Usage
Building binary
Run the following command to build the binary used in the following commands:
go build
NOTE: use the --race
flag when developing collectors.
Checking Enviroment
Run the following command (check help string for more details):
./collector-framework env verify --interface="<ptp interface>" --kubeconfig="${KUBECONFIG}"
Running Collectors
Run the following command (check help string for more details):
./collector-framework collect --interface="<ptp interface>" --kubeconfig="${KUBECONFIG}"
Fetching logs
The log subcommand has been removed. Instead we have implimented at collector which is enabled by default.
If possible you should use a log aggregator. You can control the collectors running using the --collector
flag.
Running tests
TODO: implement tests for all packages
To test the framework components run ginkgo pkg/<packagename>
, for example to run the unit tests for the config
package use ginkgo pkg/config
Contributing to the repo
See Adding a collector
To Do List
- unit tests for all of
pkg/
- add more collectors
- better data persistance options