From 43d46f0c426f4b698843ad78b631500e9ae6458a Mon Sep 17 00:00:00 2001 From: Alex Cruikshank <169613+acruikshank@users.noreply.github.com> Date: Mon, 21 Dec 2020 23:18:16 -0500 Subject: [PATCH] Run testplan on in CI (#137) * try to run test plan on ci * remove broken parameters option * move workflow definition to bottom * put job definition in jobs group * remove undefined executor configuration * use go-test tools and restore parameterization * define executor explicitly * define executor through parameters * back to ci-go * remove extraneous steps * add prepare step * fix path to test definition * fix whitespace * add k8s test and use it in ci * trigger testplan only on merge to master Co-authored-by: acruikshank --- .circleci/config.yml | 51 +++++++++++++++++++++++++++++ testplans/graphsync/env-ci.toml | 1 + testplans/graphsync/stress-k8s.toml | 35 ++++++++++++++++++++ 3 files changed, 87 insertions(+) create mode 100644 testplans/graphsync/env-ci.toml create mode 100644 testplans/graphsync/stress-k8s.toml diff --git a/.circleci/config.yml b/.circleci/config.yml index 3b31955f..645cb5d8 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -2,6 +2,52 @@ version: 2.1 orbs: ci-go: ipfs/ci-go@0.2.9 +executors: + golang: + docker: + - image: circleci/golang:1.15.5 + resource_class: 2xlarge + ubuntu: + docker: + - image: ubuntu:19.10 + +commands: + prepare: + steps: + - checkout + - git_fetch_all_tags + - checkout + git_fetch_all_tags: + steps: + - run: + name: fetch all tags + command: | + git fetch --all + +jobs: + trigger-testplans: + description: | + Trigger `graphsync` test cases on TaaS + parameters: &test-params + executor: + type: executor + default: golang + executor: << parameters.executor >> + steps: + - prepare + - run: + name: "download testground" + command: wget https://gist.github.com/nonsense/5fbf3167cac79945f658771aed32fc44/raw/2e17eb0debf7ec6bdf027c1bdafc2c92dd97273b/testground-d3e9603 -O ~/testground-cli && chmod +x ~/testground-cli + - run: + name: "prepare .env.toml" + command: pushd testplans/graphsync && mkdir -p $HOME/testground && cp env-ci.toml $HOME/testground/.env.toml && echo 'endpoint="https://ci.testground.ipfs.team"' >> $HOME/testground/.env.toml && echo 'user="circleci"' >> $HOME/testground/.env.toml + - run: + name: "prepare testground home dir" + command: mkdir -p $HOME/testground/plans && mv testplans/graphsync $HOME/testground/plans/ + - run: + name: "trigger graphsync testplan on taas" + command: ~/testground-cli run composition -f $HOME/testground/plans/graphsync/stress-k8s.toml --metadata-commit=$CIRCLE_SHA1 --metadata-repo=ipfs/go-graphsync --metadata-branch=$CIRCLE_BRANCH + workflows: version: 2 test: @@ -12,6 +58,11 @@ workflows: - ci-go/test: race: true name: "ci-go/test/race" + - trigger-testplans: + filters: + branches: + only: + - master #- ci-go/benchmark: # tolerance: 50 # requires: diff --git a/testplans/graphsync/env-ci.toml b/testplans/graphsync/env-ci.toml new file mode 100644 index 00000000..bd651c46 --- /dev/null +++ b/testplans/graphsync/env-ci.toml @@ -0,0 +1 @@ +[client] diff --git a/testplans/graphsync/stress-k8s.toml b/testplans/graphsync/stress-k8s.toml new file mode 100644 index 00000000..59fe89bf --- /dev/null +++ b/testplans/graphsync/stress-k8s.toml @@ -0,0 +1,35 @@ +[metadata] +name = "stress" + +[global] +plan = "graphsync" +case = "stress" +total_instances = 2 +builder = "docker:go" +runner = "cluster:k8s" + +[global.build_config] +push_registry=true +go_proxy_mode="remote" +go_proxy_url="http://localhost:8081" +registry_type="aws" + +[global.run.test_params] +size = "10MB" +latencies = '["50ms", "100ms", "200ms"]' +bandwidths = '["32MiB", "16MiB", "8MiB", "4MiB", "1MiB"]' +concurrency = "10" + +[[groups]] +id = "providers" +instances = { count = 1 } +[groups.resources] +memory = "4096Mi" +cpu = "1000m" + +[[groups]] +id = "requestors" +instances = { count = 1 } +[groups.resources] +memory = "4096Mi" +cpu = "1000m" \ No newline at end of file