Skip to content

Commit

Permalink
Merge pull request #149 from jbrunton/ytt-lib-test
Browse files Browse the repository at this point in the history
Add local lib test for ytt engine
  • Loading branch information
jbrunton authored Sep 22, 2020
2 parents 707fdc2 + d4db96e commit 5b764a5
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 3 deletions.
5 changes: 3 additions & 2 deletions e2e/e2e_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@ func TestUpdateCommand(t *testing.T) {
runTests(t, "./tests/update/ytt/*.yml", true)
}

func TestJPath(t *testing.T) {
runTests(t, "./tests/jpath/*.yml", false)
func TestLocalLibs(t *testing.T) {
runTests(t, "./tests/local-libs/jsonnet/*.yml", false)
runTests(t, "./tests/local-libs/ytt/*.yml", false)
}

func TestMiscErrors(t *testing.T) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ setup:
"branches":
- "develop"
run: check --show-diffs

expect:
Expand Down
45 changes: 45 additions & 0 deletions e2e/tests/local-libs/ytt/test-local-lib.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
setup:
files:
- path: .gflows/config.yml
content: |
templates:
engine: ytt
defaults:
libs:
- my-lib
- path: .gflows/my-lib/steps.lib.yml
content: |
#@ def run(action):
run: #@ action
#@ end
- path: .gflows/workflows/test/config.yml
content: |
#@ load("steps.lib.yml", "run")
"on":
push:
branches: [develop]
jobs:
hello:
runs-on: ubuntu-latest
steps:
- #@ run('echo hello, world!')
- path: .github/workflows/test.yml
content: |
# File generated by gflows, do not modify
# Source: .gflows/workflows/test
"on":
push:
branches:
- develop
jobs:
hello:
runs-on: ubuntu-latest
steps:
- run: echo hello, world!
run: check --show-diffs

expect:
output: |
Checking test ... OK
Workflows up to date

0 comments on commit 5b764a5

Please sign in to comment.