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-4659) Update environment tests #4012

Merged

Conversation

joshcooper
Copy link
Contributor

Previously, the tests failed when the master had the agent role. This
wasn't noticed originally due to PUP-4111. We also stopped testing the
agent role on the master in the lead up to Puppet 4, so once PUP-4111
was fixed, we didn't see the problem in platform CI. But puppetserver CI
does test that combination and was failing.

These commits update some of the environment related tests to
match the current and expected behavior.

Previously, the tests failed when the master had the agent role. This
wasn't noticed originally due to PUP-4111. We also stopped testing the
agent role on the master in the lead up to Puppet 4, so once PUP-4111
was fixed, we didn't see the problem in platform CI. But puppetserver CI
does test that combination and was failing.

This commit changes the following environment scenarios:

bad: Changes the expectation to match the non-existent environmentpath
specified in the main section of puppet.conf

default: Calls the `use_an_environment` method passing in a nil
environment, so that the various puppet commands don't specify
`--environment` on the command line. ALso changes the expectation to
match the default environment `production` in the resulting output, e.g.
Preparing to install into /etc/puppetlabs/code/environments/production/modules

master_environmentpath: The test tried to set an environmentpath in the
master section of puppet.conf, which wasn't different than the default,
and verify that non-master puppet commands, e.g. `puppet apply`
would fail. This commit changes the test to use a non-default
environment path for the master section only, and verify that the
various puppet commands don't "see" that directory.

[skip ci]
Minor cleanup to environment related acceptance tests. Removed unused
notify resource, added a teardown to ensure the agent's libdir is
deleted if the assert_match fails, and uses the `Host#puppet` method to
return the `user` that he master runs as.

[skip ci]
@joshcooper
Copy link
Contributor Author

Here's the output when all of the environment tests are run against redhat-7-x86_64 with the master host having the agent role.

$ git rev-parse HEAD
5673069b02f43ad3bad867520742518acc8c29ef
$ git diff
diff --git a/acceptance/config/nodes/redhat-7-x86_64.yaml b/acceptance/config/nodes/redhat-7-x86_64.yaml
index 9593c6e..a438f00 100644
--- a/acceptance/config/nodes/redhat-7-x86_64.yaml
+++ b/acceptance/config/nodes/redhat-7-x86_64.yaml
@@ -3,6 +3,7 @@ HOSTS:
   master:
     roles:
     - master
+    - agent
     platform: el-7-x86_64
     hypervisor: vcloud
     template: redhat-7-x86_64
$ be rake ci:test:aio SHA=e72e0af75d1e8e1f27ad5faaaa9cbc1d73898c0f CONFIG=config/nodes/redhat-7-x86_64.yaml TESTS=tests/environment
...
              - Test Case Summary for suite 'tests' -
       Total Suite Time: 1327.74 seconds
      Average Test Time: 69.88 seconds
              Attempted: 19
                 Passed: 19
                 Failed: 0
                Errored: 0
                Skipped: 0
                Pending: 0
                  Total: 19

@joshcooper
Copy link
Contributor Author

@er0ck for your review

@er0ck
Copy link
Contributor

er0ck commented Jun 8, 2015

oops. totally forgot to tackle this myself, last week. checking against ubuntu14

@puppetcla
Copy link

CLA signed by all contributors.

@er0ck er0ck added the PL label Jun 8, 2015
@MikaelSmith
Copy link
Contributor

👍

er0ck added a commit that referenced this pull request Jun 9, 2015
@er0ck er0ck merged commit 9a039ff into puppetlabs:stable Jun 9, 2015
@joshcooper joshcooper deleted the ticket/stable/PUP-4659-environment-tests branch August 14, 2018 05:46
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