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

Adding salt rendering to saltcheck tests #44170

Merged
merged 2 commits into from Dec 11, 2017
Merged

Adding salt rendering to saltcheck tests #44170

merged 2 commits into from Dec 11, 2017

Conversation

wcannon
Copy link
Contributor

@wcannon wcannon commented Oct 18, 2017

What does this PR do?

Adds ability to use rendering in saltcheck test files

What issues does this PR fix or reference?

None

Previous Behavior

Only supported saltcheck tests in yaml format

New Behavior

Supports standard salt rendering (e.g. yaml + jinja)

Tests written?

No - simply calling salt rendering module

Please review Salt's Contributing Guide for best practices.

@cachedout
Copy link
Contributor

Hi @wcannon

I know this is very simple code but we are trying to get everything that goes into develop to have regression tests. Can you add some basic unit tests for this new functionality?

@cachedout cachedout added the Needs-Testcase PR needs test cases written, or the issue is about a bug/feature that needs test cases label Oct 19, 2017
@wcannon
Copy link
Contributor Author

wcannon commented Oct 20, 2017

Yes. I'll add a test in the next couple days. My dev environment broke after pulling the latest commits from the development branch. Will have to set it all up again from scratch.

@mchugh19
Copy link
Contributor

In playing around with saltcheck, it is incredibly powerful and useful. It's worth pointing out in the documentation that since it uses the salt renders you can use pillars, and standard jinja markup to write tests.

For example, rather than having to hardcode package names, you can reuse the same mappings as the state making the test markup super close to the actual state file.

{% from "openssh/map.jinja" import openssh with context %}

openssh-server-latest:
  module_and_function: pkg.latest_version
  args:
    - {{ openssh.server }}
  assertion: assertEmpty

@rallytime
Copy link
Contributor

@wcannon Were you able to write some tests for this?

@wcannon
Copy link
Contributor Author

wcannon commented Dec 6, 2017 via email

@rallytime rallytime merged commit 37a6355 into saltstack:develop Dec 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs-Testcase PR needs test cases written, or the issue is about a bug/feature that needs test cases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants