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

(PUP-9653) Refactor tests using uneeded master #7512

Conversation

johnduarte
Copy link
Contributor

This PR refactors acceptance tests that are managing the master
(via with_puppet_running_on), or invoke interaction with the
master when such interaction is not necessary for the scope of
the test.

@johnduarte johnduarte requested review from a team and justinstoller May 7, 2019 20:51
@joshcooper
Copy link
Contributor

Should this retarget 5.5.x (as we'll have to support that branch for awhile)?

@joshcooper
Copy link
Contributor

Looks like some valid warnings in the updated acceptance tests:

acceptance/tests/parser_functions/puppet_lookup_cmd.rb:2584: warning: assigned but unused variable - r
...

@johnduarte johnduarte force-pushed the issues/master/pup-9653/refactor-with-puppet-running-on branch from 07cb186 to 2fe8a25 Compare May 7, 2019 21:41
@puppetcla
Copy link

CLA signed by all contributors.

@johnduarte johnduarte force-pushed the issues/master/pup-9653/refactor-with-puppet-running-on branch from 2fe8a25 to 0a29118 Compare May 28, 2019 22:17
@johnduarte johnduarte force-pushed the issues/master/pup-9653/refactor-with-puppet-running-on branch from a984c77 to e6c8ad8 Compare June 19, 2019 15:48
@joshcooper
Copy link
Contributor

Looks like a valid syntax issue:

acceptance/tests/agent/agent_disable_lockfile.rb:79: syntax error, unexpected ':', expecting keyword_end
...         acceptable_exit_codes: [1]) do |result|
...           

This commit refactors the agent_disable_lockfile test:

1. Remove the use of `with_puppet_running_on` since this test does not
   test server functionality.
2. Use the block style for `test_name` in accordance with the
   [beaker style guide](https://github.com/puppetlabs/beaker/blob/master/docs/concepts/style_guide.md)

[skip ci]
This commit refactors the agent fallback to cached catalog acceptance
test to use a catalog fixture rather than using a master to see the
catalog cache.  This removes the need to manage the puppet master, so
the use of `with_puppet_running_on` has been deleted.

[skip ci]
This commit refactors the `v4_hieradata_with_v5_configs` acceptance
test to use `puppet apply` rather than `puppet agent` to ensure
that the appropriate hiera data is looked up for environments.  This
removes the dependence on a master, so the `with_puppet_running_on`
block has been removed.
This commit refactors the `modules/changes/missing_checksums_json`
acceptance test to run on agents rather than using a master.  The
test has also been updated to comply with the beaker style guide.
This commit refactors the `modules/changes/missing_metadata_json`
acceptance test to run on agents rather than using a master.  The
test has also been updated to comply with the beaker style guide.
This commit refactors the `modules/changes/module_with_removed_file`
acceptance test to run on agents rather than using a master.  The
test has also been updated to comply with the beaker style guide.
This commit refactors the `modules/changes/invalid_module_install_path`
acceptance test to run on agents rather than using a master.  The
test has also been updated to comply with the beaker style guide.
This commit refactors the `modules/changes/module_with_modified_file`
acceptance test to run on agents rather than using a master.  The
test has also been updated to comply with the beaker style guide.
This commit refactors the `modules/changes/unmodified_module`
acceptance test to run on agents rather than using a master.  The
test has also been updated to comply with the beaker style guide.
This commit refactors the `parser_functions/hiera_hash/lookup_data`
acceptance test to run on agents rather than using a master.  The
test has also been updated to comply with the beaker style guide.
This commit refactors the `parser_functions/puppet_lookup_cmd`
acceptance test to run on agents rather than using a master.  The
test has also been updated to comply with the beaker style guide.
This commit refactors the `utf8/utf8-in-puppet-describe.rb`
acceptance test to run on agents rather than using a master.  The
test has also been updated to comply with the beaker style guide.
This commit refactors the `parser_functions/hiera_array/lookup_data.rb`
acceptance test to run on agents rather than using a master.  The
test has also been updated to comply with the beaker style guide.
This commit refactors the `parser_functions/hiera/lookup_data.rb`
acceptance test to run on agents rather than using a master.  The
test has also been updated to comply with the beaker style guide.
This commit refactors the `parser_functions/hiera_in_templates.rb`
acceptance test to run on agents rather than using a master.  The
test has also been updated to comply with the beaker style guide.
This commit refactors the
`direct_puppet/catalog_uuid_correlates_catalogs_with_reports.rb`
acceptance test to run on agents rather than using a master.  The test
has also been updated to comply with the beaker style guide.
This commit changes tests using the `mk_tmp_env` helper to introspect the
environment path from the puppet `environmentpath` rather than
hard-coding the `/tmp` directory.

This change is necessary to accommodate updates to the helper that ensure
that the `environmentpath` is updated from the temporary environment,
but that ad-hoc changes to the generated temp directory will not be
updated.  This is necessary because Windows cannot link the environment
path to the generated temp directory.
This commit removes a comment reference to links.puppet.com which
is no longer available.  The desired redirection for the link is
unknown, so no replacement link has been added.
@johnduarte johnduarte force-pushed the issues/master/pup-9653/refactor-with-puppet-running-on branch from e6c8ad8 to 802a486 Compare June 19, 2019 21:29
@jtappa
Copy link
Contributor

jtappa commented Sep 3, 2019

Looks like everything passed last time it was run, this just needs some rebasing

@jtappa
Copy link
Contributor

jtappa commented Oct 16, 2019

Hi @johnduarte, just checking in on stale PRs! If you have a moment to rebase this, it should be good to go in theory?

@johnduarte
Copy link
Contributor Author

Hi @johnduarte, just checking in on stale PRs! If you have a moment to rebase this, it should be good to go in theory?

Hey @jtappa , I am going to close this PR. I will open a new PR to target this against the 5.5.x branch as per @joshcooper 's suggestion. Thank you for your help.

@johnduarte johnduarte closed this Oct 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants