h4. What Cover the operator with test
h4. Why Ensure the quality and following the good practices.
h4. Following some references:
*Examples:* * https://github.com/operator-framework/community-operators - these are the community operators available in operatorHub.io. We can check how they are doing the tests.
*Operator-tests docs:* * https://github.com/operator-framework/operator-sdk/blob/master/doc/user/unit-testing.md * https://github.com/operator-framework/operator-sdk/blob/master/doc/design/long-term/testing-operators.md
Check if the operator-sdk has not an command to create the tests.
$ operator-sdk scorecard WARN[0000] Could not load config file; using flags Error: cr-manifest config option must be set Usage: operator-sdk scorecard [flags]
Flags: --basic-tests Enable basic operator checks (default true) --config string config file (default is <project_dir>/.osdk-scorecard.yaml) --cr-manifest string Path to manifest for Custom Resource (required) --crds-dir string Directory containing CRDs (all CRD manifest filenames must have the suffix 'crd.yaml') (default "deploy/crds") --csv-path string Path to CSV being tested --global-manifest string Path to manifest for Global resources (e.g. CRD manifests) --good-tenant-tests Enable good tenant checks -h, --help help for scorecard --init-timeout int Timeout for status block on CR to be created in seconds (default 10) --kubeconfig string Path to kubeconfig of custom resource created in cluster --namespace string Namespace of custom resource created in cluster --namespace-manifest string Path to manifest for namespaced resources (e.g. RBAC and Operator manifest) --olm-deployed The OLM has deployed the operator. Use only the CSV for test data --olm-tests Enable OLM integration checks (default true) --proxy-image string Image name for scorecard proxy (default "quay.io/operator-framework/scorecard-proxy:v0.5.0") --proxy-pull-policy string Pull policy for scorecard proxy image (default "Always") --verbose Enable verbose logging |
|