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

test(map): verify map.jinja dump using _mapdata state #132

Merged
merged 1 commit into from
Oct 30, 2020

Conversation

myii
Copy link
Member

@myii myii commented Oct 18, 2020

PR progress checklist (to be filled in by reviewers)

  • Changes to documentation are appropriate (or tick if not required)
  • Changes to tests are appropriate (or tick if not required)
  • Reviews completed

What type of PR is this?

Primary type

  • [build] Changes related to the build system
  • [chore] Changes to the build process or auxiliary tools and libraries such as documentation generation
  • [ci] Changes to the continuous integration configuration
  • [feat] A new feature
  • [fix] A bug fix
  • [perf] A code change that improves performance
  • [refactor] A code change that neither fixes a bug nor adds a feature
  • [revert] A change used to revert a previous commit
  • [style] Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc.)

Secondary type

  • [docs] Documentation changes
  • [test] Adding missing or correcting existing tests

Does this PR introduce a BREAKING CHANGE?

No.

Related issues and/or pull requests

Describe the changes you're proposing

@baby-gnu @dafyddj As discussed in the last working group meeting, map.jinja verifier for this formula, so that adjustments can be tested on Windows as well. Note that this is working for Windows in GitHub Actions using /tmp/salt_mapdata_dump.yaml.

I've also updated to the latest pre-salted images.

Pillar / config required to test the proposed changes

Debug log showing how the proposed changes work

Documentation checklist

  • Updated the README (e.g. Available states).
  • Updated pillar.example.

Testing checklist

  • Included in Kitchen (i.e. under state_top).
  • Covered by new/existing tests (e.g. InSpec, Serverspec, etc.).
  • Updated the relevant test pillar.

Additional context

@myii myii requested review from dafyddj and a team as code owners October 18, 2020 08:35
@myii myii force-pushed the test/verify_map.jinja_dump branch from 4c01898 to 16b32ab Compare October 18, 2020 10:29
openvpn/_mapdata/init.sls Outdated Show resolved Hide resolved
@myii myii force-pushed the test/verify_map.jinja_dump branch from 16b32ab to 5f011f7 Compare October 20, 2020 15:16
@myii
Copy link
Member Author

myii commented Oct 20, 2020

@dafyddj @baby-gnu This is ready for review again:

  1. Used /temp instead of /tmp for Windows.
  2. Avoided expect for the time being due to diff output issues.
  3. Adapted @dafyddj's workaround mentioned here but within init_environment instead, as suggested by @daks.

Copy link
Contributor

@baby-gnu baby-gnu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My suggestion is highly optional.

openvpn/_mapdata/init.sls Show resolved Hide resolved
test/integration/default/controls/_mapdata_spec.rb Outdated Show resolved Hide resolved
@myii
Copy link
Member Author

myii commented Oct 30, 2020

@baby-gnu @dafyddj I believe this is finally ready to go.

  1. Using YAML-based comparison instead of text-based.
  2. Using expect after all.
  3. All assignments inside the control block.
  4. While the new platforms aren't actually enabled here, I've included the new fedora-33 and arch-py3 instances.

The other main change is in the system.rb library regrading Windows platforms:

Windows (Vagrant) Windows (GitHub Actions)
Salt: grains.osfinger Windows-8.1 Windows-2019Server
InSpec: platform[:name] windows_8.1_pro windows_server_2019_datacenter
InSpec: platform[:release] 6.3.9600 10.0.17763
File name (without adjustments) windows_8.yaml windows_server_2019_datacenter-10.yaml
File name (with adjustments) windows-8.yaml windows-server-2019.yaml

Is the above OK?

Copy link
Contributor

@baby-gnu baby-gnu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work, thanks a lot.

Copy link
Contributor

@dafyddj dafyddj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTMY!

@dafyddj dafyddj merged commit c576b22 into saltstack-formulas:master Oct 30, 2020
@myii myii deleted the test/verify_map.jinja_dump branch October 30, 2020 18:15
@myii
Copy link
Member Author

myii commented Oct 30, 2020

Appreciate all of the reviews @baby-gnu, @dafyddj and @daks!

@saltstack-formulas-travis

🎉 This PR is included in version 0.16.4 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants