Skip to content

Commit

Permalink
Add tests for debug targets
Browse files Browse the repository at this point in the history
Previously if either debugging targets broke in some way, nobody would
know.  Fix this by adding simple CI tests that confirm they build and
run a basic command.

Signed-off-by: Chris Evich <[email protected]>
  • Loading branch information
cevich committed Aug 16, 2024
1 parent ab6fa66 commit 87a7115
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
21 changes: 21 additions & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,26 @@ win_images_task:
path: win_images/manifest.json
type: application/json

# These targets are intended for humans, make sure they builds and function on a basic level
test_debug_task:
name: "Test ${TARGET} make target"
alias: test_debug_task
only_if: *is_pr
skip: *ci_docs
depends_on:
- validate
gce_instance:
<<: *ibi_vm
matrix:
- env:
TARGET: ci_debug
- env:
TARGET: image_builder_debug
env:
GAC_FILEPATH: "/dev/null"
AWS_SHARED_CREDENTIALS_FILE: "/dev/null"
DBG_TEST_CMD: "true"
script: make ${TARGET}

# Test metadata addition to images (built or not) to ensure container functions
test_imgts_task: &imgts
Expand Down Expand Up @@ -532,6 +552,7 @@ success_task:
- base_images
- cache_images
- win_images
- test_debug
- test_imgts
- imgts
- test_imgobsolete
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ ci_debug: $(_TEMPDIR)/ci_debug.iid ## Build and enter container for local develo
-e GAC_FILEPATH=$(GAC_FILEPATH) \
-e AWS_SHARED_CREDENTIALS_FILE=$(AWS_SHARED_CREDENTIALS_FILE) \
-e TEMPDIR=$(_TEMPDIR) \
$(call imageid,$<)
$(call imageid,$<) $(if $(DBG_TEST_CMD),$(DBG_TEST_CMD),)

# Takes 3 arguments: IID filepath, FQIN, context dir
define podman_build
Expand Down Expand Up @@ -268,7 +268,7 @@ image_builder_debug: $(_TEMPDIR)/image_builder_debug.iid ## Build and enter cont
-e IMG_SFX=$(call err_if_empty,_IMG_SFX) \
-e GAC_FILEPATH=$(GAC_FILEPATH) \
-e AWS_SHARED_CREDENTIALS_FILE=$(AWS_SHARED_CREDENTIALS_FILE) \
$(call imageid,$<)
$(call imageid,$<) $(if $(DBG_TEST_CMD),$(DBG_TEST_CMD))

$(_TEMPDIR)/image_builder_debug.iid: $(_TEMPDIR) $(wildcard image_builder/*)
$(call podman_build,$@,image_builder_debug,image_builder)
Expand Down

0 comments on commit 87a7115

Please sign in to comment.