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

Add testing for Windows (both local and CI) #471

Merged
merged 4 commits into from
Jun 28, 2020

Conversation

dafyddj
Copy link
Contributor

@dafyddj dafyddj commented Jun 11, 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

Add local testing for Windows using Vagrant.
Add CI testing for Windows using GitHub Actions.
Fix a regression in Windows default values.

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

@pull-assistant
Copy link

pull-assistant bot commented Jun 11, 2020

@myii
Copy link
Member

myii commented Jun 11, 2020

@dafyddj The Gemfile.lock adjustments would need to be added to this PR as well, so that the existing Linux testing can actually run. Will propose some changes to the tests as well, to get them passing the Rubocop violations as well as make them a bit more Rubyish.

Copy link
Member

@myii myii left a comment

Choose a reason for hiding this comment

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

To fix the Rubocop violations and make the code more Rubyish. To be honest, I'd prefer it even more if these sections could be embedded in the controls themselves, like it's been done here:

https://github.com/saltstack-formulas/tomcat-formula/blob/4602740178af04242d96583f453d7c50f3dc74e3/test/integration/default/controls/services_spec.rb#L10-L27

Comment on lines 3 to 12
if os[:family] == 'windows'
pkgs = %w[
Salt\ Minion
]
else
pkgs = %w[
salt-master
salt-minion
]
end
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if os[:family] == 'windows'
pkgs = %w[
Salt\ Minion
]
else
pkgs = %w[
salt-master
salt-minion
]
end
pkgs =
case platform[:family]
when 'windows'
%w[Salt\ Minion]
else
%w[salt-master salt-minion]
end

Comment on lines 3 to 12
if os[:family] == 'windows'
services = %w[
salt-minion
]
else
services = %w[
salt-master
salt-minion
]
end
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if os[:family] == 'windows'
services = %w[
salt-minion
]
else
services = %w[
salt-master
salt-minion
]
end
services =
case platform[:family]
when 'windows'
%w[salt-minion]
else
%w[salt-master salt-minion]
end

@dafyddj dafyddj force-pushed the test-windows branch 3 times, most recently from 97ecdaf to e17d327 Compare June 24, 2020 23:03
@myii
Copy link
Member

myii commented Jun 26, 2020

@dafyddj Note that the Gemfile.lock has been updated as part of the weekly maintenance. Apologies for the extra work required here because of that.

@dafyddj dafyddj marked this pull request as ready for review June 26, 2020 16:23
@dafyddj dafyddj requested review from a team as code owners June 26, 2020 16:23
myii added a commit to myii/ssf-formula that referenced this pull request Jun 28, 2020
@myii myii merged commit 38e3856 into saltstack-formulas:master Jun 28, 2020
@myii
Copy link
Member

myii commented Jun 28, 2020

Checked using myii/ssf-formula#234.


Lovely work, @dafyddj -- merged.

One thing from the review above:

... To be honest, I'd prefer it even more if these sections could be embedded in the controls themselves, like it's been done here:

https://github.com/saltstack-formulas/tomcat-formula/blob/4602740178af04242d96583f453d7c50f3dc74e3/test/integration/default/controls/services_spec.rb#L10-L27

  • How do you feel about this adjustment being made here?

@saltstack-formulas-travis

🎉 This PR is included in version 1.4.5 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@dafyddj
Copy link
Contributor Author

dafyddj commented Jun 30, 2020

Thanks for the merge.

  • How do you feel about this adjustment being made here?

I believe there's a better place for this kind of "configuration" and we should probably look into using Inputs instead.

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.

3 participants