-
Notifications
You must be signed in to change notification settings - Fork 18
Convert from Litmus to Cucumber #89
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
Conversation
997725b
to
9a64917
Compare
end | ||
|
||
task default: [:spec, :features] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note there is no rubocop because it's not defined, despite including rubocop/rake_task
on line 2. Ideally that should actually be there.
desc 'Run acceptance tests' | ||
task :acceptance do | ||
Rake::Task['litmus:acceptance:localhost'].invoke | ||
Cucumber::Rake::Task.new(:features) do |t| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that right now this isn't run in CI because that explicitly calls spec
.
.github/workflows/ci.yml
Outdated
@@ -25,17 +25,3 @@ jobs: | |||
secrets: "inherit" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure about your comment:
This works locally, but I don't know what CI runs.
The run commands are from the line just above this comment (github does not allow me to comment on the right line). This "expand" to:
https://github.com/puppetlabs/cat-github-actions/blob/main/.github/workflows/gem_ci.yml
Overall 💯 🤩 for cucumber AFAIAC!
Then it has 1 error and 0 warnings | ||
|
||
Scenario: containing a control statement | ||
Given a file named "ignore.pp" with: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I first did have a version which loaded fixtures, but decided to inline things here for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is more readable to have the content here 💯 .
@@ -0,0 +1,7 @@ | |||
Then('it has {int} error/errors and {int} warning/warnings') do |error, warning| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to follow cucumber style convention, we should use conditional here and use the point of view of the user (I run, ...). I also think the foo/bar
syntax is less suited than foo(s)
here:
Then('it has {int} error/errors and {int} warning/warnings') do |error, warning| | |
Then('I should see {int} error(s) and {int} warning(s)') do |error, warning| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked at the style, but first tried regexes. That didn't work, but this looks cleaner.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hehe, I should probably have quoted "style" because there is no real reference / ultimate source of truth that I am aware of: much more experience that piles up with the years 🤷 (even if I only do some cucumber 3 of 4 times a year).
I don't remember which version of gherkin changed the game and allowed this flexible syntax instead of bare regular expressions.
Anyway, the doc points to this repository that is handy:
https://github.com/cucumber/cucumber-expressions
"test" # lint:ignore:double_quoted_strings | ||
""" | ||
When I run `puppet-lint ignore.pp` | ||
Then it has 0 errors and 0 warnings |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
then we can update the manifest:
Then it has 0 errors and 0 warnings | |
Then I should see 0 errors and 0 warnings |
9a64917
to
b645225
Compare
RuboCop failures should be fixed by #157. |
b645225
to
fd8ec30
Compare
Not sure that I see the issue behind this in regard to the localhost, Litmus is running the test on the local machine as shown here: Line 44 in d0e5560
And as to the circular dependency, while I can somewhat see this, adding an additional testing framework for this one instance seems to us to be to be to much of an increased overhead in order to fix something that does not seem to be impacting anything. If we are missing anything in regards to this situation please point it out and we can take another look, but at this moment it does not seem to be of enough benefit to match the costs. |
I don't want Litmus running on my machine because it uses Bolt, which has opt-out analytics (https://www.puppet.com/docs/bolt/latest/analytics.html). So out of principle I will never use Litmus. It's developer hostile to me. That is a big motivation for me to move to Cucumber. |
I totally agree with @ekohl here. |
I guess this is difficult for us, we ultimately need to make informed decisions on how to develop on our products and can't do that without analytics. It doesn't sound like detailing the data and purpose would help here but it may be worth while us discussing with bolt team because the PDK had been on google analytics before the version upgrade meant this wasn't useable for applications as it was |
So just to confirm Bolt is now in the same place as PDK and google analytics isn't available |
I think this is a strong statement that needs proper argumentation. I'm in the position that I rather maintain an alternative development stack in Vox Pupuli than use the Puppet tooling because of analytics. So I'm not touching PDK, Bolt and Litmus but rather maintain modulesync and Beaker. It's true I largely make sure my own workflows work well, which is different from running a product. One of the results of Puppet's choice to mandate analytics is that the user base is split into two camps. It's one way to develop a product, but is it the best? |
As a maintainer I understand this, but I still think it should be opt-in, not opt-out. |
Hello things have moved on in this debate @ekohl @bastelfreak @smortex and we have removed google analytics from PDK and other products since it was no longer valid and was a community issue. As I go into building out the full q3 plan for Bolt, is it a safe assumption that if bolt similarly removes analytics this is no longer an issue? We will review new analytics in the future but from my discussions with legal an opt in model would be our approach in future implementations. |
Hi @davidsandilands , thanks for the update!
Thanks, I appreciate that.
As @ekohl mentioned in the initial PR description: I think litmus is the wrong tool. It just makes the test setup more complex and this complexity isn't required. Also what's the future of litmus? I don't think it makes sense to maintain litmus and beaker and the last statement from Josh was that all the puppet agent/PE related pipelines won't move away from beaker. |
As @bastelfreak said, I appreciate removing the telemetry but Litmus is a very heavy weight solution that just isn't needed here. You don't need a full machine just to run Ruby application code. |
This switches away from Litmus because it's the wrong tool. Cucumber can easily run locally without having to spin up a completely separate machine. It also doesn't create a circular dependency (because puppetlabs_spec_helper depends on puppet-lint).
@ekohl following on from our conversation at community triage we don't have the resources to implement this right now given the impact this would have across our estate. Thanks |
@danadoherty639 can you please elaborate on the 'impact across your estate'? |
This switches away from Litmus because it's the wrong tool. Cucumber can easily run locally without having to spin up a completely separate machine. It also doesn't create a circular dependency (because puppetlabs_spec_helper depends on puppet-lint).
This works locally, but I don't know what CI runs. It also has one TODO, with the version expectation.