Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print stderr from helm test failures #39698

Merged

Conversation

dstandish
Copy link
Contributor

@dstandish dstandish commented May 18, 2024

Previously you would not see the error message; you'd only see that the command failed. Now you'll see it.

Here's an example of what it looks like now:

test_basic_helm_chart.py:551: in test_invalid_pull_policy
    render_chart(
../../tests/charts/helm_template_generator.py:145: in render_chart
    raise HelmFailedError(result.returncode, result.args, result.stdout, result.stderr)
E   tests.charts.helm_template_generator.HelmFailedError: Helm command failed. Args: (1, ['helm', 'template', 'test-basic', '/Users/dstandish/code/airflow/chart', '--values', '/var/folders/9c/tknx7xx10qx92983y1r5djb40000gn/T/tmpbmxoj2yj', '--kube-version', '1.29.1', '--namespace', 'default'], b'', b'Error: values don\'t meet the specifications of the schema(s) in the following chart(s):\nairflow:\n- images.flower.pullPolicy: images.flower.pullPolicy must be one of the following: "Always", "Never", "IfNotPresent"\n\n')
E   Stderr: 
E   Error: values don't meet the specifications of the schema(s) in the following chart(s):
E   airflow:
E   - images.flower.pullPolicy: images.flower.pullPolicy must be one of the following: "Always", "Never", "IfNotPresent"
FAILED [ 50%]
helm_tests/airflow_aux/test_basic_helm_chart.py:544 (TestBaseChartTest.test_invalid_pull_policy[statsd])

Before you would only have seen something like this:

helm_tests/airflow_core/test_rpc_server.py:578 (TestRPCServerDeployment.test_rpc_server_security_context_legacy)
../../tests/charts/helm_template_generator.py:141: in render_chart
    result.check_returncode()
../../../../.pyenv/versions/3.11.3/lib/python3.11/subprocess.py:502: in check_returncode
    raise CalledProcessError(self.returncode, self.args, self.stdout,
E   subprocess.CalledProcessError: Command '['helm', 'template', 'release-name', '/Users/dstandish/code/airflow/chart', '--values', '/var/folders/9c/tknx7xx10qx92983y1r5djb40000gn/T/tmpcbo2q6kz', '--kube-version', '1.29.1', '--namespace', 'default', '--show-only', 'templates/rpc-server/rpc-server-deployment.yaml']' returned non-zero exit status 1.

Previously you would not see the error message; you'd only see that the command failed.  Now you'll see it.

(cherry picked from commit df2da72)
@dstandish dstandish merged commit 70f868e into apache:main May 18, 2024
42 checks passed
@dstandish dstandish deleted the print-stderr-from-helm-test-failures branch May 18, 2024 15:54
RNHTTR pushed a commit to RNHTTR/airflow that referenced this pull request Jun 1, 2024
Previously you would not see the error message; you'd only see that the command failed.  Now you'll see it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants