PromucFlow_constructor/deploy/helm/tests/README.md
Wyatt Walter 4c7a019adf
fix: support nss wrapper in Helm chart (#40673)
## Description

Requires: https://github.com/appsmithorg/appsmith/pull/40642

Adds an environment variable activating nss_wrapper when the
`securityPolicy.runAsUser` value is set so the UID can be set
dynamically. This avoids the `I have no name!` in the prompt when doing
a `kubectl exec` with that value set.

I am also introducing
[helm-unittest](https://github.com/helm-unittest/helm-unittest) for
ensuring that changes to our defaults are made explicit.

Fixes https://github.com/appsmithorg/appsmith/issues/38787

## Automation

/ok-to-test tags=""

### 🔍 Cypress test results
<!-- This is an auto-generated comment: Cypress test results  -->
> [!WARNING]
> Tests have not run on the HEAD
d30d87ffc66c107f980a3b27464e97db0910dcbe yet
> <hr>Mon, 19 May 2025 18:59:10 UTC
<!-- end of auto-generated comment: Cypress test results  -->


## Communication
Should the DevRel and Marketing teams inform users about this change?
- [ ] Yes
- [ ] No


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **New Features**
- Added automated unit testing for Helm charts, including snapshot and
security context tests.
- Introduced documentation for running and understanding Helm chart unit
tests.
- Added a GitHub Actions workflow to run Helm chart unit tests on pull
requests and manually.
- **Bug Fixes**
- Ensured the LD_PRELOAD environment variable is set when a specific
security context is configured in deployments.
- **Documentation**
- Updated Helm chart README to reference new testing documentation and
improve clarity.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Goutham Pratapa <goutham@appsmith.com>
2025-06-04 20:54:46 +05:30

1.2 KiB

Helm Chart Unit Tests

This directory contains unit tests for our Helm charts using helm-unittest, a BDD-style testing framework for Helm charts.

Running Tests Locally

You can run the tests locally using Docker:

docker run -ti --rm -v $(pwd):/apps helmunittest/helm-unittest .

Snapshot Testing

Our tests use snapshot testing to validate the rendered Kubernetes manifests. This ensures that any changes to the defaults are intentional and reviewed.

Updating Snapshots

When making changes that affect the rendered output (like updating labels or other metadata), you'll need to update the snapshots. This is particularly important during releases when labels are updated.

To update snapshots, run the tests with the -u flag:

docker run -ti --rm -v $(pwd):/apps helmunittest/helm-unittest -u .

Important: Always review the changes in the snapshots before committing them to ensure they match your expectations.

Documentation

For more information about helm-unittest, including:

  • Writing test cases
  • Available assertions
  • Test suite configuration
  • Best practices

Please refer to the official helm-unittest documentation.