Skip to content

Commit

Permalink
sdp-k8s-injector: add simple CLI testing
Browse files Browse the repository at this point in the history
Full testing requires a k8s environment.
  • Loading branch information
OddBloke committed Feb 3, 2025
1 parent 9a57585 commit 916b308
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions sdp-k8s-injector.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,35 @@ subpackages:
- runs: |
mkdir -p ${{targets.subpkgdir}}/usr/bin/
mv ${{targets.destdir}}/usr/bin/${{range.key}} ${{targets.subpkgdir}}/usr/bin/
test:
pipeline:
- runs: &write_log4rs_config |
cat << 'EOF' > log4rs.yaml
appenders:
# An appender named "stdout" that writes to stdout
stdout:
kind: console

# Set the default logging level to "warn" and attach the "stdout" appender to the root
root:
level: warn
appenders:
- stdout
EOF
- runs: |
SDP_LOG_CONFIG_FILE=log4rs.yaml ${{range.key}} --help
update:
enabled: true
github:
identifier: appgate/sdp-k8s-injector
strip-prefix: v
strip-suffix: -sdp-k8s-injector-crd

test:
pipeline:
- runs: *write_log4rs_config
- runs: |
# sdp-injector expects full valid k8s configuration, so we just check
# for the expected error due to its absence
SDP_LOG_CONFIG_FILE=log4rs.yaml sdp-injector 2>&1 | grep -q "Unable to infer Kubernetes config:"

0 comments on commit 916b308

Please sign in to comment.