Skip to content

Commit

Permalink
CH-142 Added testing of dockerfile configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
condar-metacell committed Aug 12, 2024
1 parent d0b286a commit 6a550e7
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions applications/samples/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ ARG CLOUDHARNESS_FLASK

FROM $CLOUDHARNESS_FRONTEND_BUILD as frontend

ARG TEST_ARGUMENT=default
RUN echo $TEST_ARGUMENT

ENV APP_DIR=/app

WORKDIR ${APP_DIR}
Expand Down
4 changes: 3 additions & 1 deletion applications/samples/deploy/values-minimal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,6 @@ harness:
soft: []
hard: []
use_services: []

dockerfile:
buildArgs:
TEST_ARGUMENT: 'minimal value'
4 changes: 4 additions & 0 deletions applications/samples/deploy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,7 @@ harness:
- "--request-timeout=180000"
- "--hypothesis-max-examples=2"
- "--show-errors-tracebacks"

dockerfile:
buildArgs:
TEST_ARGUMENT: example value
2 changes: 2 additions & 0 deletions tools/deployment-cli-tools/tests/test_skaffold.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ def test_create_skaffold_configuration():
a for a in sk['build']['artifacts'] if a['image'] == 'reg/cloudharness/samples'
)
assert os.path.samefile(samples_artifact['context'], join(CLOUDHARNESS_ROOT, 'applications/samples'))
assert 'TEST_ARGUMENT' in samples_artifact['docker']['buildArgs']
assert samples_artifact['docker']['buildArgs']['TEST_ARGUMENT'] == 'example value'

myapp_artifact = next(
a for a in sk['build']['artifacts'] if a['image'] == 'reg/cloudharness/myapp')
Expand Down

0 comments on commit 6a550e7

Please sign in to comment.