Giter VIP home page Giter VIP logo

test-infra's Introduction

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_harness

anchore-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 Parameters

Most 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

test-infra's People

Contributors

btodhunter avatar robertp avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.