Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/anchore/test-infra
Contains infrastructure for running functional tests using Helm chart deployments
https://github.com/anchore/test-infra
Last synced: 3 days ago
JSON representation
Contains infrastructure for running functional tests using Helm chart deployments
- Host: GitHub
- URL: https://github.com/anchore/test-infra
- Owner: anchore
- Created: 2019-04-02T17:50:19.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-08-19T21:32:19.000Z (3 months ago)
- Last Synced: 2024-08-20T01:21:42.196Z (3 months ago)
- Language: Python
- Size: 25.1 MB
- Stars: 4
- Watchers: 16
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Anchore CI/Test Harness
This repository provides an entry point and set of shared tasks for testing and CI. It allows any provided task to be easily overridden. Currently this is for use with Python.
## Usage Example
To use the provided task `clean`, clone this repo into your project's root directory, and create the following variables and targets in your makefile:
```
TEST_IMAGE_NAME := my_image:latest
TEST_HARNESS_REPO := https://github.com/anchore/test-infra.git
CI_CMD := anchore-ci/ci_harnessanchore-ci: ## Fetch test artifacts for the CI harness
rm -rf /tmp/test-infra; git clone $(TEST_HARNESS_REPO) /tmp/test-infra
mv ./anchore-ci ./anchore-ci-`date +%F-%H-%M-%S`; mv /tmp/test-infra/anchore-ci ..PHONY: clean
clean: anchore-ci ## Clean up the project directory and delete dev image
@$(CI_CMD) clean $(TEST_IMAGE_NAME)
```To override the provided task with your own `clean`, provide an executable in `./scripts/ci/clean`, and the test harness entry point will invoke your task instead.
Add the following to your .gitignore file so you don't pull in the test harness artifacts (unless you want to):
```
# CI scripts
anchore-ci*/
```The following tasks are provided (run `./anchore-ci/ci_harness` to see a current list in case this has changed):
```
clean
cluster-down
cluster-up
install-cluster-deps
lint
push-dev-image
push-prod-image-rebuild
push-prod-image-release
push-rc-image
test-functional
test-unit
```
## Provided Task Required ParametersMost of the provided tasks require some parameters to execute; some also require a virtual environment to be activated already - otherwise, your local/system Python is required to be configured 'correctly'. These are listed below. Please see the sample makefile provided in this repo for a full example.
Task | Required Parameters | Virtual environment activation required
---- | --------- | --------
clean | TEST_IMAGE_NAME | No
lint | None | Yes
test-unit | None | Yes
test-functional | None | Yes
install-cluster-deps | VENV | No
cluster-up | CLUSTER_NAME, CLUSTER_CONFIG,
KUBERNETES_VERSION | Yes
cluster-down | CLUSTER_NAME | Yes
push-dev-image | COMMIT_SHA, DEV_IMAGE_REPO,
GIT_BRANCH, TEST_IMAGE_NAME | No
push-rc-image | COMMIT_SHA, DEV_IMAGE_REPO,
GIT_TAG | No
push-prod-image-rebuild | DEV_IMAGE_REPO, GIT_BRANCH,
GIT_TAG, PROD_IMAGE_REPO | No
push-prod-image-reelase | DEV_IMAGE_REPO, GIT_BRANCH,
GIT_TAG, PROD_IMAGE_REPO | No