Skip to content

Commit

Permalink
feat(ci): support colorized output in GitHub Actions (#149) (#150)
Browse files Browse the repository at this point in the history
Close #149
  • Loading branch information
jlandowner authored Dec 27, 2024
1 parent 127f426 commit f462662
Show file tree
Hide file tree
Showing 6 changed files with 202 additions and 142 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ jobs:

- name: Integration test
run: |
make integ-test GO=go
FORCE_COLOR=1 make integ-test GO=go
- name: Integration test kong
run: |
make integ-test-kong
FORCE_COLOR=1 make integ-test-kong
20 changes: 20 additions & 0 deletions __snapshots__/main_test.snap
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,29 @@ Use --debug flag to render out invalid YAML
['rootCmd fail snapshot is different should fail 1']
SnapShot = 'snapshot does not match chart=example/app1 values=example/app1/testfail/test_ingress_enabled.yaml'

['rootCmd fail snapshot is different should fail 2']
SnapShot = """
RUNS Snapshot testing chart=example/app1 values=example/app1/testfail/test_ingress_enabled.yaml
FAIL Snapshot does not match chart=example/app1 values=example/app1/testfail/test_ingress_enabled.yaml snapshot_version=v2
"""
['rootCmd fail values directory contains not matched snapshots should fail 1']
SnapShot = 'snapshot does not match chart=example/app1 values=example/app1/testfail/test_ingress_enabled.yaml'

['rootCmd fail values file not found should fail 1']
SnapShot = """
values file 'example/app1/test_latest/notfound.yaml' not found"""

['rootCmd success env FORCE_COLOR is enabled should force a colorized output 1']
SnapShot = """
\u001B[37;44m RUNS \u001B[0m\u001B[0m Snapshot testing chart=example/app1 values=example/app1/test_latest/test_ingress_enabled.yaml
\u001B[0m\u001B[37;42m PASS \u001B[0m\u001B[32m Snapshot matched chart=example/app1 values=example/app1/test_latest/test_ingress_enabled.yaml snapshot_version=v3
\u001B[0m\u001B[37;42m PASS \u001B[0m\u001B[32m All snapshots matched
\u001B[0m"""
['rootCmd success snapshot local chart with single values file should pass 1']
SnapShot = """
RUNS Snapshot testing chart=example/app1 values=example/app1/test_latest/test_ingress_enabled.yaml
PASS Snapshot matched chart=example/app1 values=example/app1/test_latest/test_ingress_enabled.yaml snapshot_version=v3
PASS All snapshots matched
"""
6 changes: 3 additions & 3 deletions coverage.out
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ github.com/jlandowner/helm-chartsnap/main.go:98: initRootCmd 85.2%
github.com/jlandowner/helm-chartsnap/main.go:198: main 0.0%
github.com/jlandowner/helm-chartsnap/main.go:205: slogHandler 100.0%
github.com/jlandowner/helm-chartsnap/main.go:218: loadSnapshotConfig 57.1%
github.com/jlandowner/helm-chartsnap/main.go:231: run 89.2%
github.com/jlandowner/helm-chartsnap/main.go:358: bannerPrintln 100.0%
github.com/jlandowner/helm-chartsnap/main.go:365: printOptions 100.0%
github.com/jlandowner/helm-chartsnap/main.go:231: run 89.6%
github.com/jlandowner/helm-chartsnap/main.go:365: bannerPrintln 100.0%
github.com/jlandowner/helm-chartsnap/main.go:372: printOptions 100.0%
github.com/jlandowner/helm-chartsnap/pkg/api/v1alpha1/header.go:13: ToString 100.0%
github.com/jlandowner/helm-chartsnap/pkg/api/v1alpha1/header.go:17: ParseHeader 100.0%
github.com/jlandowner/helm-chartsnap/pkg/api/v1alpha1/testspec.go:11: FromFile 100.0%
Expand Down
Loading

0 comments on commit f462662

Please sign in to comment.