Skip to content

Commit

Permalink
tests: Merge uuid5 test with general templating tests
Browse files Browse the repository at this point in the history
Setting up the test fixtures takes quite some time, so merge the uuid5
tests into the templating tests. Also simplify it somewhat by just using
`test` rather then diff

Signed-off-by: Sjoerd Simons <[email protected]>
  • Loading branch information
sjoerdsimons committed Jan 13, 2024
1 parent f1a2441 commit 9f88f57
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 24 deletions.
15 changes: 15 additions & 0 deletions tests/templating/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,18 @@ actions:
description: sprig conversion function
chroot: false
command: test 42 -eq {{ 0x2a | int }}

# expected.uuid5 contains value generated with $namespace and $text1
{{ $namespace := or .namespace "6c9d1418-8fa9-11ee-b4ca-325096b39f47" }}
{{ $text1 := or .text1 "ver1.0" }}
{{ $text2 := or .text2 "ver2.0" }}
{{ $expected := or .expected "3deb2a0e-692c-5a37-93c0-1123948bf5ae" }}

- action: run
description: test uuid5 generate same value when input is same
chroot: false
command: test {{ uuid5 $namespace $text1 }} = {{ $expected }}
- action: run
description: test uuid5 generate different value when input is different
chroot: false
command: test {{ uuid5 $namespace $text2 }} != {{ $expected }}
1 change: 0 additions & 1 deletion tests/uuid5/expected.uuid5

This file was deleted.

23 changes: 0 additions & 23 deletions tests/uuid5/test.yaml

This file was deleted.

0 comments on commit 9f88f57

Please sign in to comment.