run_common_tests.sh 677 B

123456789101112131415161718192021222324252627
  1. #!/bin/bash
  2. # https://github.com/helm-unittest/helm-unittest
  3. # -- You need to install this helm plugin
  4. # helm plugin install https://github.com/helm-unittest/helm-unittest
  5. common_test_path="library/common-test"
  6. function cleanup {
  7. if [ -d "$common_test_path/charts" ]; then
  8. echo "🧹 Cleaning up charts..."
  9. rm -r "$common_test_path/charts"
  10. rm "$common_test_path/Chart.lock"
  11. # Clean snapshots
  12. rm -r "$common_test_path/**/__snapshot__" 2> /dev/null
  13. fi
  14. }
  15. cleanup
  16. echo "🔨 Building common..."
  17. helm dependency update "$common_test_path"
  18. echo "🧪 Running tests..."
  19. helm unittest --update-snapshot -f "tests/*/*.yaml" "./$common_test_path"
  20. cleanup