Skip to content

Commit

Permalink
Merge branch 'argoproj:master' into analysis-terminal-decision-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
agrawroh authored Jul 18, 2022
2 parents 20618be + f2c1d8a commit 8d7095f
Show file tree
Hide file tree
Showing 20 changed files with 1,510 additions and 1,039 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/e2e-test-results.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Test Results

on:
workflow_run:
workflows: ["E2E Tests", "Go"]
types:
- completed
permissions: {}

jobs:
test-results:
name: "${{ github.event.workflow.name }} Test Results"
runs-on: ubuntu-latest
if: github.event.workflow_run.conclusion != 'skipped'
permissions:
checks: write
pull-requests: write
actions: read
steps:
- name: Download and Extract Artifacts
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
run: |
mkdir -p artifacts && cd artifacts
artifacts_url=${{ github.event.workflow_run.artifacts_url }}
gh api "$artifacts_url" -q '.artifacts[] | [.name, .archive_download_url] | @tsv' | while read artifact
do
IFS=$'\t' read name url <<< "$artifact"
gh api $url > "$name.zip"
unzip -d "$name" "$name.zip"
done
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
with:
check_name: "${{ github.event.workflow.name }} Published Test Results"
commit: ${{ github.event.workflow_run.head_sha }}
event_file: artifacts/Event File/event.json
event_name: ${{ github.event.workflow_run.event }}
files: "artifacts/**/*.xml"
compare_to_earlier_commit: false
test_changes_limit: 0
fail_on: "errors"
19 changes: 19 additions & 0 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,15 @@ concurrency:
cancel-in-progress: true

jobs:
event_file:
name: "Event File"
runs-on: ubuntu-latest
steps:
- name: Upload
uses: actions/upload-artifact@v2
with:
name: Event File
path: ${{ github.event_path }}
test-e2e:
name: Run end-to-end tests
runs-on: ubuntu-latest
Expand Down Expand Up @@ -58,6 +67,16 @@ jobs:
- name: Run e2e tests
run: make test-e2e
if: ${{ !(github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled) }}
- name: Output Rerun Overview
run: |
[[ -f rerunreport.txt ]] && cat rerunreport.txt || echo "No rerun report found"
- name: Upload E2E Test Results
if: always()
uses: actions/upload-artifact@v2
with:
name: E2E Test Results
path: |
junit.xml
- name: Upload e2e-controller logs
uses: actions/upload-artifact@v2
with:
Expand Down
19 changes: 18 additions & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,15 @@ concurrency:
cancel-in-progress: true

jobs:
event_file:
name: "Event File"
runs-on: ubuntu-latest
steps:
- name: Upload
uses: actions/upload-artifact@v2
with:
name: Event File
path: ${{ github.event_path }}
lint-go:
name: Lint Go code
runs-on: ubuntu-latest
Expand Down Expand Up @@ -58,7 +67,15 @@ jobs:
run: make controller plugin

- name: Test
run: go test -failfast -covermode=count -coverprofile=coverage.out ./...
run: make test-unit

- name: Upload Unit Test Results
if: always()
uses: actions/upload-artifact@v2
with:
name: Unit Test Results
path: |
junit.xml
- name: Generate code coverage artifacts
uses: actions/upload-artifact@v2
Expand Down
17 changes: 13 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ DEV_IMAGE=false
# E2E variables
E2E_INSTANCE_ID ?= argo-rollouts-e2e
E2E_TEST_OPTIONS ?=
E2E_PARALLEL ?= 4
E2E_PARALLEL ?= 1
E2E_WAIT_TIMEOUT ?= 120

override LDFLAGS += \
Expand Down Expand Up @@ -79,9 +79,13 @@ install-go-tools-local: go-mod-vendor
install-protoc-local:
./hack/installers/install-protoc.sh

.PHONY: install-devtools-local
install-devtools-local:
./hack/installers/install-dev-tools.sh

# Installs all tools required to build and test locally
.PHONY: install-tools-local
install-tools-local: install-go-tools-local install-protoc-local
install-tools-local: install-go-tools-local install-protoc-local install-devtools-local

TYPES := $(shell find pkg/apis/rollouts/v1alpha1 -type f -name '*.go' -not -name openapi_generated.go -not -name '*generated*' -not -name '*test.go')
APIMACHINERY_PKGS=k8s.io/apimachinery/pkg/util/intstr,+k8s.io/apimachinery/pkg/api/resource,+k8s.io/apimachinery/pkg/runtime/schema,+k8s.io/apimachinery/pkg/runtime,k8s.io/apimachinery/pkg/apis/meta/v1,k8s.io/api/core/v1,k8s.io/api/batch/v1
Expand Down Expand Up @@ -212,8 +216,13 @@ start-e2e:
go run ./cmd/rollouts-controller/main.go --instance-id ${E2E_INSTANCE_ID} --loglevel debug --kloglevel 6

.PHONY: test-e2e
test-e2e:
go test -timeout 30m -v -count 1 --tags e2e -p ${E2E_PARALLEL} --short ./test/e2e ${E2E_TEST_OPTIONS}
test-e2e: install-devtools-local
${DIST_DIR}/gotestsum --rerun-fails-report=rerunreport.txt --junitfile=junit.xml --format=testname --packages="./test/e2e" --rerun-fails=5 -- -timeout 60m -count 1 --tags e2e -p ${E2E_PARALLEL} -parallel ${E2E_PARALLEL} -v --short ./test/e2e ${E2E_TEST_OPTIONS}

.PHONY: test-unit
test-unit: install-devtools-local
${DIST_DIR}/gotestsum --junitfile=junit.xml --format=testname --packages="./..." -- -covermode=count -coverprofile=coverage.out ./...


.PHONY: coverage
coverage: test
Expand Down
53 changes: 53 additions & 0 deletions docs/features/kustomize/rollout_cr_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,17 @@
},
"type": "object"
},
"influxdb": {
"properties": {
"profile": {
"type": "string"
},
"query": {
"type": "string"
}
},
"type": "object"
},
"job": {
"properties": {
"metadata": {
Expand Down Expand Up @@ -3965,6 +3976,10 @@
"format": "int32",
"type": "integer"
},
"minDomains": {
"format": "int32",
"type": "integer"
},
"topologyKey": {
"type": "string"
},
Expand Down Expand Up @@ -4515,6 +4530,17 @@
},
"type": "object"
},
"influxdb": {
"properties": {
"profile": {
"type": "string"
},
"query": {
"type": "string"
}
},
"type": "object"
},
"job": {
"properties": {
"metadata": {
Expand Down Expand Up @@ -8214,6 +8240,10 @@
"format": "int32",
"type": "integer"
},
"minDomains": {
"format": "int32",
"type": "integer"
},
"topologyKey": {
"type": "string"
},
Expand Down Expand Up @@ -8764,6 +8794,17 @@
},
"type": "object"
},
"influxdb": {
"properties": {
"profile": {
"type": "string"
},
"query": {
"type": "string"
}
},
"type": "object"
},
"job": {
"properties": {
"metadata": {
Expand Down Expand Up @@ -12463,6 +12504,10 @@
"format": "int32",
"type": "integer"
},
"minDomains": {
"format": "int32",
"type": "integer"
},
"topologyKey": {
"type": "string"
},
Expand Down Expand Up @@ -16532,6 +16577,10 @@
"format": "int32",
"type": "integer"
},
"minDomains": {
"format": "int32",
"type": "integer"
},
"topologyKey": {
"type": "string"
},
Expand Down Expand Up @@ -19662,6 +19711,10 @@
"format": "int32",
"type": "integer"
},
"minDomains": {
"format": "int32",
"type": "integer"
},
"topologyKey": {
"type": "string"
},
Expand Down
Loading

0 comments on commit 8d7095f

Please sign in to comment.