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

Litmus conversion #1175

Merged
merged 57 commits into from May 30, 2019
Merged

Litmus conversion #1175

merged 57 commits into from May 30, 2019

Conversation

pmcmaw
Copy link
Contributor

@pmcmaw pmcmaw commented Mar 28, 2019

No description provided.

@pmcmaw pmcmaw force-pushed the litmus_conversion branch 13 times, most recently from e995ca7 to 95df01e Compare April 2, 2019 14:43
@pmcmaw pmcmaw closed this Apr 2, 2019
@pmcmaw pmcmaw reopened this Apr 2, 2019
@pmcmaw pmcmaw force-pushed the litmus_conversion branch 7 times, most recently from 2599ae4 to b995f1b Compare April 3, 2019 13:53
@pmcmaw pmcmaw closed this Apr 4, 2019
@pmcmaw pmcmaw reopened this Apr 4, 2019
@pmcmaw pmcmaw force-pushed the litmus_conversion branch 6 times, most recently from 3a30dcb to c4c0257 Compare April 5, 2019 23:54
end
end

describe 'mysqlbackup.sh' do
describe 'mysqlbackup.sh', if: Gem::Version.new(mysql_version) < Gem::Version.new('5.7.0') do

Choose a reason for hiding this comment

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

Instead of putting the skip at this level, you might consider putting a skip in a before block using this condition as in this change.
The advantage gained is that you can then see in the CI output exactly which it blocks were skipped, which gives increased visibility into exactly how many tests are not being run on a give CI configuration and for what reason, while still reducing the verbosity and repetitiveness of the previous pattern of the unless block in every test.
We moved to this pattern recently because our inability to answer that question was causing issues for us.

shell('/usr/local/sbin/mysqlbackup.sh') do |r|
expect(r.stderr).to eq('')
end
run_shell('/usr/local/sbin/mysqlbackup.sh') do |r|

Choose a reason for hiding this comment

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

Does the module create the file mysqlbackup.sh? It seems like this command run_shell('/usr/local/sbin/mysqlbackup.sh') could be moved into a before(:each) block, and then the it's on 39 and 52 could be removed in favor of simply the two it's on 45 and 58.
This would have the additional advantage of more properly modeling the relationship that needs to occur between the run_shell command that needs to run before each test, and the test itself. Currently the run_shell is in an it that is not specifically related to the it immediately preceding. The it on 39 for example seems like it's just test setup for the it it on 45, but that relationship is not currently modeled by the way the file is arranged.
I have no expectation that the current arrangement would fail any time soon, so I'm not proposing to hold up merge for this suggestion.

@tphoney
Copy link
Contributor

tphoney commented May 30, 2019

@RandomNoun7 whole heartedly agree with both of these, i can clean this up after we get this merged. I had to go through a horror show of a rebase 🤢 due to the multiple commits.
I was trying my best to leave the structure of tests alone as much as possible.

@RandomNoun7 RandomNoun7 merged commit ad5bb08 into master May 30, 2019
@eimlav eimlav added the feature label Jun 10, 2019
@sheenaajay sheenaajay deleted the litmus_conversion branch September 18, 2019 09:53
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.

None yet

4 participants