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

enable acceptance tests #469

Merged
merged 1 commit into from
Dec 2, 2018
Merged

Conversation

Dan33l
Copy link
Member

@Dan33l Dan33l commented Dec 1, 2018

Pull Request (PR) description

First work to enable beaker acceptance tests in the module.

Code to make tests was already present. It expected some output. And now i get no output at all.

This Pull Request (PR) fixes the following issues

@bastelfreak
Copy link
Member

@Dan33l should we merge this as is or do you want to work more on it?

@bastelfreak bastelfreak added the needs-feedback Further information is requested label Dec 2, 2018
@Dan33l
Copy link
Member Author

Dan33l commented Dec 2, 2018

We could merge as this.
But i am interested by understanding why the original code expect some output. Now, when i check manually same commands i get no output at all.
If it's because the tested software has evolved, we should probably have the tests evolve as well.

describe 'System Ruby with No SSL, Not protected, No mcollective' do
context 'default parameters' do
let(:pp) do
"
pp = %(
Copy link
Member

Choose a reason for hiding this comment

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

Why should this not be a let block anymore?

Copy link
Member Author

Choose a reason for hiding this comment

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

IMO, it is clearer in this way.

Copy link
Member

Choose a reason for hiding this comment

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

There is a difference in evaluation and https://stackoverflow.com/questions/5359558/when-to-use-rspec-let/5359979#5359979 outlines why let blocks are preferred.

ensure => present,
}
)
apply_manifest(ensure_puppet_user_exists, catch_failures: true)
Copy link
Member

Choose a reason for hiding this comment

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

A shorter way to write this is on host, puppet('resource', 'user', 'ensure=present'). Otherwise you should apply_manifest_on(host, ensure_puppet_user_exists, catch_failures: true) for it to work correctly on multiple nodes

Copy link
Member Author

Choose a reason for hiding this comment

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

With this shorter way i got this log :

centos7-64-1 23:05:44$ puppet resource user ensure=present
  user { 'ensure=present':
    ensure => 'absent',
  }

And even with puppet resource user puppet, it is yet produced ensure=>absent. hu!

Copy link
Member

Choose a reason for hiding this comment

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

Oh, it should have been on host, puppet('resource', 'user', 'puppet', 'ensure=present')

Copy link
Member

Choose a reason for hiding this comment

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

And you should have at least looked at my other comment. This current version is applying the same manifest only on the default node for every host. In a single node env that doesn't matter, but it's a bad example and people copy paste.

@Dan33l Dan33l changed the title WIP : enable acceptance tests enable acceptance tests Dec 2, 2018
@Dan33l
Copy link
Member Author

Dan33l commented Dec 2, 2018

Since the keyword success is not in the output, i added a check of missing You shall not pass.

@Dan33l Dan33l merged commit c8f5eb6 into voxpupuli:master Dec 2, 2018

# rubocop:disable RSpec/MultipleExpectations
it 'successfully locks when hammered with multiple requests' do
Copy link
Member

Choose a reason for hiding this comment

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

I do wonder about the concurrency here. describe blocks are run separate so you might be changing the test to run 4 commands sequentially while the test is actually run 4 commands in parallel.

describe 'System Ruby with No SSL, Not protected, No mcollective' do
context 'default parameters' do
let(:pp) do
"
pp = %(
Copy link
Member

Choose a reason for hiding this comment

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

There is a difference in evaluation and https://stackoverflow.com/questions/5359558/when-to-use-rspec-let/5359979#5359979 outlines why let blocks are preferred.

@Dan33l Dan33l deleted the enable_acceptance_tests branch December 2, 2018 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-feedback Further information is requested
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants