Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,11 @@ test-short: ## Execute the Golang's tests for updatecli

.PHONY: test-e2e
test-e2e: ## Execute updatecli end to end tests
echo $$VENOM_VAR_binpath
@echo "==\nUsing the following updatecli binary (from variable 'VENOM_VAR_binpath'): $(VENOM_VAR_binpath)/updatecli\n=="
@test -n "$$GITHUB_TOKEN" || { echo "Undefined required variable 'GITHUB_TOKEN'"; exit 1; }
@test -n "$$GITHUB_ACTOR" || { echo "Undefined required variable 'GITHUB_ACTOR'"; exit 1; }
time venom run e2e/venom.d/* --output-dir ./e2e --format yaml


.PHONY: lint
lint: ## Execute the Golang's linters on updatecli's source code
golangci-lint run
Expand Down
15 changes: 9 additions & 6 deletions e2e/updatecli.d/deprecated.d/transformers.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: "Test transformers"

scms:
local:
disabled: true

sources:
add:
name: Get latest Jenkins version
Expand Down Expand Up @@ -49,34 +53,33 @@ sources:
- semverInc: major

conditions:
add:
add:
name: "Expected"
kind: shell
disablesourceinput: true
spec:
command: '[ "{{ source "add" }}" == "v1.0.0-alpha" ]'
trim:
trim:
name: "Expected"
kind: shell
disablesourceinput: true
spec:
command: '[ "{{ source "trim" }}" == "1.0.0" ]'
replacers:
replacers:
name: "Expected"
kind: shell
disablesourceinput: true
spec:
command: '[ "{{ source "replacers" }}" == "1.0.0" ]'
findsubmatch:
findsubmatch:
name: "Expected"
kind: shell
disablesourceinput: true
spec:
command: '[ "{{ source "findsubmatch" }}" == "1.0" ]'
semverinc:
semverinc:
name: "Expected"
kind: shell
disablesourceinput: true
spec:
command: '[ "{{ source "semverinc" }}" == "2.0.0" ]'

4 changes: 4 additions & 0 deletions e2e/updatecli.d/skipped.targets.d/multiple-conditions.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
title: Skip targets with only one (failing) condition

scms:
local:
disabled: true

sources:
default:
name: Default Source (dummy)
Expand Down
4 changes: 4 additions & 0 deletions e2e/updatecli.d/skipped.targets.d/one-condition.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
title: Skip targets with only one (failing) condition

scms:
local:
disabled: true

sources:
default:
name: Default Source (dummy)
Expand Down
18 changes: 11 additions & 7 deletions e2e/updatecli.d/success.d/command.yaml
Original file line number Diff line number Diff line change
@@ -1,33 +1,37 @@
title: Test Various target scenario

scms:
local:
disabled: true

targets:
1:
1:
name: Should be succeeding
kind: shell
spec:
command: "true"

# 2:
# name: Should be failling
# 2:
# name: Should be failing
# kind: shell
# spec:
# command: "false"
#
# 3:
# name: Should be failling
# 3:
# name: Should be failing
# kind: shell
# spec:
# command: "false"
#
# 4:
# 4:
# name: Should be skipped
# depends_on:
# - "2"
# kind: shell
# spec:
# command: "false"

5:
5:
name: Should be succeeding
kind: shell
depends_on:
Expand Down
12 changes: 7 additions & 5 deletions e2e/updatecli.d/success.d/helmchart.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
name: Helm Chart Integration Test

scms:
local:
disabled: true
default:
kind: git
spec:
url: https://github.com/epinio/helm-charts.git
url: https://github.com/epinio/helm-charts.git

sources:
default:
Expand All @@ -24,7 +26,7 @@ conditions:
version: 3.6.2

targets:
default:
default:
name: Test Chart Update
scmid: default
kind: helmchart
Expand All @@ -33,7 +35,7 @@ targets:
file: Chart.yaml
key: dependencies[0].version

fakeAppVersion:
fakeAppVersion:
name: Test Chart Update
scmid: default
kind: helmchart
Expand All @@ -44,7 +46,7 @@ targets:
key: dependencies[1].version
versionincrement: minor

fakeVersionInc:
fakeVersionInc:
name: Test Chart Update
scmid: default
kind: helmchart
Expand All @@ -54,7 +56,7 @@ targets:
appversion: true
key: dependencies[2].version
versionincrement: minor,major
noVersionInc:
noVersionInc:
name: Test Chart Update
scmid: default
kind: helmchart
Expand Down
4 changes: 4 additions & 0 deletions e2e/updatecli.d/success.d/jenkins.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
title: "Bump Jenkins stable version"

scms:
local:
disabled: true

sources:
getLatestJenkinsStable:
kind: jenkins
Expand Down
4 changes: 4 additions & 0 deletions e2e/updatecli.d/success.d/maven.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
---
title: Show a set of maven resources as a generic example

scms:
local:
disabled: true

sources:
getLatestJenkinsWarVersion:
kind: maven
Expand Down
2 changes: 2 additions & 0 deletions e2e/updatecli.d/success.d/source/gitTag.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
title: "Test new gitTag resource"

scms:
local:
disabled: true
updatecli:
kind: git
spec:
Expand Down
8 changes: 6 additions & 2 deletions e2e/updatecli.d/success.d/source/githubRelease.2.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
---
title: Test source githubRelease

scms:
local:
disabled: true

sources:
helm:
name: "Get Latest updatecli release version"
kind: "githubrelease"
spec:
owner: "updatecli"
repository: "updatecli"
token: '{{ requiredEnv .github.token }}'
username: '{{ requiredEnv .github.username }}'
token: '{{ requiredEnv "GITHUB_TOKEN" }}'
username: '{{ requiredEnv "GITHUB_ACTOR" }}'
versionfilter:
kind: "latest"
16 changes: 4 additions & 12 deletions e2e/updatecli.d/success.d/source/githubRelease.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,8 @@
title: Test source githubRelease

scms:
updatecli:
kind: "github"
spec:
user: "updatecli"
email: "updatecli@olblak.com"
owner: "updatecli"
repository: "updatecli"
token: '{{ requiredEnv .github.token }}'
username: '{{ requiredEnv .github.username }}'
branch: "main"
local:
disabled: true

sources:
helm:
Expand All @@ -20,7 +12,7 @@ sources:
spec:
owner: "updatecli"
repository: "updatecli"
token: '{{ requiredEnv .github.token }}'
username: '{{ requiredEnv .github.username }}'
token: '{{ requiredEnv "GITHUB_TOKEN" }}'
username: '{{ requiredEnv "GITHUB_ACTOR" }}'
versionfilter:
kind: latest
15 changes: 9 additions & 6 deletions e2e/updatecli.d/success.d/transformers.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
name: "Test transformers"

scms:
local:
disabled: true

sources:
add:
name: Get latest Jenkins version
Expand Down Expand Up @@ -49,34 +53,33 @@ sources:
- semverinc: major

conditions:
add:
add:
name: "Expected"
kind: shell
disablesourceinput: true
spec:
command: '[ "{{ source "add" }}" == "v1.0.0-alpha" ]'
trim:
trim:
name: "Expected"
kind: shell
disablesourceinput: true
spec:
command: '[ "{{ source "trim" }}" == "1.0.0" ]'
replacers:
replacers:
name: "Expected"
kind: shell
disablesourceinput: true
spec:
command: '[ "{{ source "replacers" }}" == "1.0.0" ]'
findsubmatch:
findsubmatch:
name: "Expected"
kind: shell
disablesourceinput: true
spec:
command: '[ "{{ source "findsubmatch" }}" == "1.0" ]'
semverinc:
semverinc:
name: "Expected"
kind: shell
disablesourceinput: true
spec:
command: '[ "{{ source "semverinc" }}" == "2.0.0" ]'

4 changes: 0 additions & 4 deletions e2e/values.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion e2e/venom.d/test_deprecated.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ vars:
testcases:
- name: "Test updatecli diff shouldn't fail"
steps:
- script: '{{ .binpath }}/updatecli diff --config ../updatecli.d/deprecated.d --values ../values.yaml'
- script: '{{ .binpath }}/updatecli diff --config ../updatecli.d/deprecated.d'
type: 'exec'
assertions:
- 'result.code ShouldEqual 0'
Expand Down
2 changes: 1 addition & 1 deletion e2e/venom.d/test_diff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ vars:
testcases:
- name: "Test updatecli diff shouldn't fail"
steps:
- script: '{{ .binpath }}/updatecli diff --config ../updatecli.d/success.d --values ../values.yaml'
- script: '{{ .binpath }}/updatecli diff --config ../updatecli.d/success.d'
type: 'exec'
assertions:
- 'result.code ShouldEqual 0'
Expand Down
2 changes: 1 addition & 1 deletion e2e/venom.d/test_skipped_targets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ testcases:
- 'result.systemout ShouldContainSubstring "shouldNeverRun:"'
- name: "Test that no target is ever run in this set of updatecli manifests"
steps:
- script: '{{ .binpath }}/updatecli diff --config ../updatecli.d/skipped.targets.d/ --values ../values.yaml'
- script: '{{ .binpath }}/updatecli diff --config ../updatecli.d/skipped.targets.d/'
type: 'exec'
assertions:
- 'result.code ShouldEqual 0'
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ require (
github.com/gorilla/mux v1.8.0 // indirect
github.com/gosuri/uitable v0.0.4 // indirect
github.com/goware/prefixer v0.0.0-20160118172347-395022866408 // indirect
github.com/goware/urlx v0.3.1 // indirect
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -460,6 +460,8 @@ github.com/gosuri/uitable v0.0.4 h1:IG2xLKRvErL3uhY6e1BylFzG+aJiwQviDDTfOKeKTpY=
github.com/gosuri/uitable v0.0.4/go.mod h1:tKR86bXuXPZazfOTG1FIzvjIdXzd0mo4Vtn16vt0PJo=
github.com/goware/prefixer v0.0.0-20160118172347-395022866408 h1:Y9iQJfEqnN3/Nce9cOegemcy/9Ai5k3huT6E80F3zaw=
github.com/goware/prefixer v0.0.0-20160118172347-395022866408/go.mod h1:PE1ycukgRPJ7bJ9a1fdfQ9j8i/cEcRAoLZzbxYpNB/s=
github.com/goware/urlx v0.3.1 h1:BbvKl8oiXtJAzOzMqAQ0GfIhf96fKeNEZfm9ocNSUBI=
github.com/goware/urlx v0.3.1/go.mod h1:h8uwbJy68o+tQXCGZNa9D73WN8n0r9OBae5bUnLcgjw=
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7 h1:pdN6V1QBWetyv/0+wjACpqVH+eVULgEjkurDLq3goeM=
github.com/gregjones/httpcache v0.0.0-20180305231024-9cad4c3443a7/go.mod h1:FecbI9+v66THATjSRHfNgh1IVFe/9kFxbXtjV0ctIMA=
github.com/grpc-ecosystem/go-grpc-middleware v1.0.0/go.mod h1:FiyG127CGDf3tlThmgyCl78X/SZQqEOJBCDaAfeWzPs=
Expand Down
Loading