From b6168a3060752474bb1ba4bd961ac119eddce16f Mon Sep 17 00:00:00 2001 From: Chewing_Bever Date: Tue, 13 Dec 2022 12:38:39 +0100 Subject: [PATCH] fix(build): change tests to use BuildConfig instead --- src/build/shell_test.v | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/src/build/shell_test.v b/src/build/shell_test.v index 341df88..d228faf 100644 --- a/src/build/shell_test.v +++ b/src/build/shell_test.v @@ -1,42 +1,48 @@ module build -import models { Target } +import models fn test_create_build_script_git_branch() { - target := Target{ - id: 1 + config := BuildConfig{ + target_id: 1 kind: 'git' url: 'https://examplerepo.com' branch: 'main' repo: 'vieter' + base_image: 'not-used:latest' } - build_script := create_build_script('https://example.com', target, 'x86_64') + + build_script := create_build_script('https://example.com', config, 'x86_64') expected := $embed_file('build_script_git_branch.sh') assert build_script == expected.to_string().trim_space() } fn test_create_build_script_git() { - target := Target{ - id: 1 + config := BuildConfig{ + target_id: 1 kind: 'git' url: 'https://examplerepo.com' repo: 'vieter' + base_image: 'not-used:latest' } - build_script := create_build_script('https://example.com', target, 'x86_64') + + build_script := create_build_script('https://example.com', config, 'x86_64') expected := $embed_file('build_script_git.sh') assert build_script == expected.to_string().trim_space() } fn test_create_build_script_url() { - target := Target{ - id: 1 + config := BuildConfig{ + target_id: 1 kind: 'url' url: 'https://examplerepo.com' repo: 'vieter' + base_image: 'not-used:latest' } - build_script := create_build_script('https://example.com', target, 'x86_64') + + build_script := create_build_script('https://example.com', config, 'x86_64') expected := $embed_file('build_script_url.sh') assert build_script == expected.to_string().trim_space()