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

Fixing failing development tests #179

Merged
merged 5 commits into from
Jun 19, 2020
Merged

Fixing failing development tests #179

merged 5 commits into from
Jun 19, 2020

Conversation

Tamerz
Copy link
Contributor

@Tamerz Tamerz commented Mar 25, 2020

I updated spec_helper_acceptance.rb with the one from a Puppetlabs module:

https://github.com/puppetlabs/puppetlabs-ntp/blob/master/spec/spec_helper_acceptance.rb

This seems to allow the tests to pass.

I also tried to get rid of a few deprecation warnings by changing the syntax of a few commands.

@Tamerz
Copy link
Contributor Author

Tamerz commented Mar 26, 2020

This passes on my fork. I'm not sure why it still fails here:

https://travis-ci.org/github/Tamerz/puppet_os_patching

@albatrossflavour albatrossflavour merged commit 81159c1 into albatrossflavour:development Jun 19, 2020
@albatrossflavour
Copy link
Owner

Great fix, thank you

albatrossflavour pushed a commit that referenced this pull request Jun 22, 2020
* Update README.md (#162)

Went through the README.md for spelling/grammar/outdated info

* Inconsistence between facter and manifest (#164)

* Inconsistence between facter and manifest

os_patching.rb line 94

* _ is also in \w

* Improve os_patching::patch_after_healthcheck plan (#167)

* Update patch_after_healthcheck.pp

* Replace notice() with out::message()

* Give plan control over noop_state and runinterval

* Syntax correction

Forgot commas in plan parameter definitions

* Code owner file

* Working on #180 : Adding rescue to allow code to continue after NoMethodError on .match (#181)

Co-authored-by: Tim McLaughlin <mclaugtd@wwu.edu>

* Update os_patching_fact_generation.sh (#175)

I have a system where yum is currently outputting this:
```
Update notice RHSA-2019:3193 (from rhel-7-server-rpms) is broken, or a bad duplicate, skipping.
You should report this problem to the owner of the rhel-7-server-rpms repository.
If you are the owner, consider re-running the same command with --verbose to see the exact data that caused the conflict.
```

The "is broken" check excludes that first line, but then I end up with `os_patching.package_updates => [ "You", "If" ]` in my facts and the system doesn't show up as patched.

So, I propose that instead of trying to `egrep -v` away a small set of known problem lines from yum, this should carefully match  lines that match the pattern of the output when a yum update is available. (`${rpmname}.${arch}   ${version}   ${repo}` where all whitespace is variable and lines may have trailing whitespace).

* Fixing failing development tests (#179)

* Trying to fix testing failures

* Replaced deprecated '--nodes' parameter with '--targets' parameter.

* Updated spec_helper_acceptance.rb

* Removed trailing spaces to fix the following syntax check 'plans/patch_after_healthcheck.pp - ERROR: trailing whitespace found on line 9'

* Trying to fix 'spec/spec_helper_acceptance.rb:32:5: W: Lint/UnneededDisable: Unnecessary disabling of Metrics/BlockNesting.'

Co-authored-by: Tames McTigue <tames@northwestern.edu>

* Travis fixes

Co-authored-by: Linas <linas@daneliukas.eu>
Co-authored-by: Elfranne <tom.braarup@gmail.com>
Co-authored-by: Kevin Reeuwijk <kevin.reeuwijk@puppet.com>
Co-authored-by: Tim McLaughlin <sharumpe@users.noreply.github.com>
Co-authored-by: Tim McLaughlin <mclaugtd@wwu.edu>
Co-authored-by: Eric Eisenhart <freiheit@gmail.com>
Co-authored-by: Tames McTigue <tames@tamerz.com>
Co-authored-by: Tames McTigue <tames@northwestern.edu>
albatrossflavour pushed a commit that referenced this pull request May 9, 2021
* Trying to fix testing failures

* Replaced deprecated '--nodes' parameter with '--targets' parameter.

* Updated spec_helper_acceptance.rb

* Removed trailing spaces to fix the following syntax check 'plans/patch_after_healthcheck.pp - ERROR: trailing whitespace found on line 9'

* Trying to fix 'spec/spec_helper_acceptance.rb:32:5: W: Lint/UnneededDisable: Unnecessary disabling of Metrics/BlockNesting.'

Co-authored-by: Tames McTigue <tames@northwestern.edu>
albatrossflavour pushed a commit that referenced this pull request May 9, 2021
* Update README.md (#162)

Went through the README.md for spelling/grammar/outdated info

* Inconsistence between facter and manifest (#164)

* Inconsistence between facter and manifest

os_patching.rb line 94

* _ is also in \w

* Improve os_patching::patch_after_healthcheck plan (#167)

* Update patch_after_healthcheck.pp

* Replace notice() with out::message()

* Give plan control over noop_state and runinterval

* Syntax correction

Forgot commas in plan parameter definitions

* Code owner file

* Working on #180 : Adding rescue to allow code to continue after NoMethodError on .match (#181)

Co-authored-by: Tim McLaughlin <mclaugtd@wwu.edu>

* Update os_patching_fact_generation.sh (#175)

I have a system where yum is currently outputting this:
```
Update notice RHSA-2019:3193 (from rhel-7-server-rpms) is broken, or a bad duplicate, skipping.
You should report this problem to the owner of the rhel-7-server-rpms repository.
If you are the owner, consider re-running the same command with --verbose to see the exact data that caused the conflict.
```

The "is broken" check excludes that first line, but then I end up with `os_patching.package_updates => [ "You", "If" ]` in my facts and the system doesn't show up as patched.

So, I propose that instead of trying to `egrep -v` away a small set of known problem lines from yum, this should carefully match  lines that match the pattern of the output when a yum update is available. (`${rpmname}.${arch}   ${version}   ${repo}` where all whitespace is variable and lines may have trailing whitespace).

* Fixing failing development tests (#179)

* Trying to fix testing failures

* Replaced deprecated '--nodes' parameter with '--targets' parameter.

* Updated spec_helper_acceptance.rb

* Removed trailing spaces to fix the following syntax check 'plans/patch_after_healthcheck.pp - ERROR: trailing whitespace found on line 9'

* Trying to fix 'spec/spec_helper_acceptance.rb:32:5: W: Lint/UnneededDisable: Unnecessary disabling of Metrics/BlockNesting.'

Co-authored-by: Tames McTigue <tames@northwestern.edu>

* Try and fix travis

* Travis fixes

* Tune travis

* Tuned

* more travis

* ruby version

* timeout

* 2.6.6

* 2.4.1

* 2.4.1

* Updated PDK version

* Testing

* ruby-version

* rubocop

* rubocop

* Larger testing pool

* debian too

* match Debian-Security (#185)

Co-authored-by: dru <dru.grote@neovera.com>

* puppetlabs-translate deprecated (#189)

Hey Tony! We are deprecating the translate module and noticed that you
were using it here.

* Do not hardcode the path of AIO commands (#168)

Prefer AIO Puppet / Ruby if available, but use the system's version for non AIO
nodes.  This unbreaks the module for non-AIO installs (e.g. using the
distribution packages and not the Puppetlabs ones).

Co-authored-by: Tony Green <tgreen@bandcamp.tv>

* fix(patch_server) change regex after yum history (#171)

when names are too long yum history truncates and replaces names by
'...'
```
ID     | Login user               | Date and time    | Action(s)      |
Altered
-------------------------------------------------------------------------------
    66 | Foo ... <foo>    | 2020-01-24 16:10 | Update         |    1
    65 | Bar ... <bar>    | 2020-01-24 16:06 | Downgrade      |    1
```
Thanks to stephanevalk for the regex :)

* rev metadata

* Prep for 0.14.0 release

* changelog

* Fixing failing development tests (#179)

* Trying to fix testing failures

* Replaced deprecated '--nodes' parameter with '--targets' parameter.

* Updated spec_helper_acceptance.rb

* Removed trailing spaces to fix the following syntax check 'plans/patch_after_healthcheck.pp - ERROR: trailing whitespace found on line 9'

* Trying to fix 'spec/spec_helper_acceptance.rb:32:5: W: Lint/UnneededDisable: Unnecessary disabling of Metrics/BlockNesting.'

Co-authored-by: Tames McTigue <tames@northwestern.edu>

* Try and fix travis

* Tune travis

* Tuned

* timeout

* Updated PDK version

* rubocop

* rubocop

* match Debian-Security (#185)

Co-authored-by: dru <dru.grote@neovera.com>

* puppetlabs-translate deprecated (#189)

Hey Tony! We are deprecating the translate module and noticed that you
were using it here.

* Do not hardcode the path of AIO commands (#168)

Prefer AIO Puppet / Ruby if available, but use the system's version for non AIO
nodes.  This unbreaks the module for non-AIO installs (e.g. using the
distribution packages and not the Puppetlabs ones).

Co-authored-by: Tony Green <tgreen@bandcamp.tv>

* fix(patch_server) change regex after yum history (#171)

when names are too long yum history truncates and replaces names by
'...'
```
ID     | Login user               | Date and time    | Action(s)      |
Altered
-------------------------------------------------------------------------------
    66 | Foo ... <foo>    | 2020-01-24 16:10 | Update         |    1
    65 | Bar ... <bar>    | 2020-01-24 16:06 | Downgrade      |    1
```
Thanks to stephanevalk for the regex :)

* rev metadata

* Prep for 0.14.0 release

* changelog

* changelog

* Revert

* Take out travis testing

* post litmus revisions

Co-authored-by: Linas <linas@daneliukas.eu>
Co-authored-by: Elfranne <tom.braarup@gmail.com>
Co-authored-by: Kevin Reeuwijk <kevin.reeuwijk@puppet.com>
Co-authored-by: Tim McLaughlin <sharumpe@users.noreply.github.com>
Co-authored-by: Tim McLaughlin <mclaugtd@wwu.edu>
Co-authored-by: Eric Eisenhart <freiheit@gmail.com>
Co-authored-by: Tames McTigue <tames@tamerz.com>
Co-authored-by: Tames McTigue <tames@northwestern.edu>
Co-authored-by: dru <drug@neovera.net>
Co-authored-by: dru <dru.grote@neovera.com>
Co-authored-by: Ben Ford <ben.ford@puppetlabs.com>
Co-authored-by: Romain Tartière <romain@blogreen.org>
Co-authored-by: bmx0r <michael.boutillier@gmail.com>
albatrossflavour pushed a commit that referenced this pull request May 11, 2021
* Update README.md (#162)

Went through the README.md for spelling/grammar/outdated info

* Inconsistence between facter and manifest (#164)

* Inconsistence between facter and manifest

os_patching.rb line 94

* _ is also in \w

* Improve os_patching::patch_after_healthcheck plan (#167)

* Update patch_after_healthcheck.pp

* Replace notice() with out::message()

* Give plan control over noop_state and runinterval

* Syntax correction

Forgot commas in plan parameter definitions

* Code owner file

* Working on #180 : Adding rescue to allow code to continue after NoMethodError on .match (#181)

Co-authored-by: Tim McLaughlin <mclaugtd@wwu.edu>

* Update os_patching_fact_generation.sh (#175)

I have a system where yum is currently outputting this:
```
Update notice RHSA-2019:3193 (from rhel-7-server-rpms) is broken, or a bad duplicate, skipping.
You should report this problem to the owner of the rhel-7-server-rpms repository.
If you are the owner, consider re-running the same command with --verbose to see the exact data that caused the conflict.
```

The "is broken" check excludes that first line, but then I end up with `os_patching.package_updates => [ "You", "If" ]` in my facts and the system doesn't show up as patched.

So, I propose that instead of trying to `egrep -v` away a small set of known problem lines from yum, this should carefully match  lines that match the pattern of the output when a yum update is available. (`${rpmname}.${arch}   ${version}   ${repo}` where all whitespace is variable and lines may have trailing whitespace).

* Fixing failing development tests (#179)

* Trying to fix testing failures

* Replaced deprecated '--nodes' parameter with '--targets' parameter.

* Updated spec_helper_acceptance.rb

* Removed trailing spaces to fix the following syntax check 'plans/patch_after_healthcheck.pp - ERROR: trailing whitespace found on line 9'

* Trying to fix 'spec/spec_helper_acceptance.rb:32:5: W: Lint/UnneededDisable: Unnecessary disabling of Metrics/BlockNesting.'

Co-authored-by: Tames McTigue <tames@northwestern.edu>

* Try and fix travis

* Travis fixes

* Tune travis

* Tuned

* more travis

* ruby version

* timeout

* 2.6.6

* 2.4.1

* 2.4.1

* Updated PDK version

* Testing

* ruby-version

* rubocop

* rubocop

* Larger testing pool

* debian too

* match Debian-Security (#185)

Co-authored-by: dru <dru.grote@neovera.com>

* puppetlabs-translate deprecated (#189)

Hey Tony! We are deprecating the translate module and noticed that you
were using it here.

* Do not hardcode the path of AIO commands (#168)

Prefer AIO Puppet / Ruby if available, but use the system's version for non AIO
nodes.  This unbreaks the module for non-AIO installs (e.g. using the
distribution packages and not the Puppetlabs ones).

Co-authored-by: Tony Green <tgreen@bandcamp.tv>

* fix(patch_server) change regex after yum history (#171)

when names are too long yum history truncates and replaces names by
'...'
```
ID     | Login user               | Date and time    | Action(s)      |
Altered
-------------------------------------------------------------------------------
    66 | Foo ... <foo>    | 2020-01-24 16:10 | Update         |    1
    65 | Bar ... <bar>    | 2020-01-24 16:06 | Downgrade      |    1
```
Thanks to stephanevalk for the regex :)

* rev metadata

* Prep for 0.14.0 release

* changelog

* Fixing failing development tests (#179)

* Trying to fix testing failures

* Replaced deprecated '--nodes' parameter with '--targets' parameter.

* Updated spec_helper_acceptance.rb

* Removed trailing spaces to fix the following syntax check 'plans/patch_after_healthcheck.pp - ERROR: trailing whitespace found on line 9'

* Trying to fix 'spec/spec_helper_acceptance.rb:32:5: W: Lint/UnneededDisable: Unnecessary disabling of Metrics/BlockNesting.'

Co-authored-by: Tames McTigue <tames@northwestern.edu>

* Try and fix travis

* Tune travis

* Tuned

* timeout

* Updated PDK version

* rubocop

* rubocop

* match Debian-Security (#185)

Co-authored-by: dru <dru.grote@neovera.com>

* puppetlabs-translate deprecated (#189)

Hey Tony! We are deprecating the translate module and noticed that you
were using it here.

* Do not hardcode the path of AIO commands (#168)

Prefer AIO Puppet / Ruby if available, but use the system's version for non AIO
nodes.  This unbreaks the module for non-AIO installs (e.g. using the
distribution packages and not the Puppetlabs ones).

Co-authored-by: Tony Green <tgreen@bandcamp.tv>

* fix(patch_server) change regex after yum history (#171)

when names are too long yum history truncates and replaces names by
'...'
```
ID     | Login user               | Date and time    | Action(s)      |
Altered
-------------------------------------------------------------------------------
    66 | Foo ... <foo>    | 2020-01-24 16:10 | Update         |    1
    65 | Bar ... <bar>    | 2020-01-24 16:06 | Downgrade      |    1
```
Thanks to stephanevalk for the regex :)

* rev metadata

* Prep for 0.14.0 release

* changelog

* changelog

* Revert

* Take out travis testing

* post litmus revisions

* #165 clear out references to bolt `nodes` and change them to `targets`.  Thanks @elfranne

* expand filter inline and remove $FILTER variables (#188)

* #192 testing enhanced regex for yum history

* fix facter no longer working on puppet 7 (#191)

* fix facter no longer working on puppet 7

* using puppet config print vardir

`puppet config print vardir` is quicker to execute

* Puppet 7 facts

* passes acceptance tests on both puppet 6 and 7

* pre-0.15.0 release

Co-authored-by: Linas <linas@daneliukas.eu>
Co-authored-by: Elfranne <tom.braarup@gmail.com>
Co-authored-by: Kevin Reeuwijk <kevin.reeuwijk@puppet.com>
Co-authored-by: Tim McLaughlin <sharumpe@users.noreply.github.com>
Co-authored-by: Tim McLaughlin <mclaugtd@wwu.edu>
Co-authored-by: Eric Eisenhart <freiheit@gmail.com>
Co-authored-by: Tames McTigue <tames@tamerz.com>
Co-authored-by: Tames McTigue <tames@northwestern.edu>
Co-authored-by: dru <drug@neovera.net>
Co-authored-by: dru <dru.grote@neovera.com>
Co-authored-by: Ben Ford <ben.ford@puppetlabs.com>
Co-authored-by: Romain Tartière <romain@blogreen.org>
Co-authored-by: bmx0r <michael.boutillier@gmail.com>
Co-authored-by: Michael Johnson <51394770+michael-letsengage@users.noreply.github.com>
Co-authored-by: Massimiliano Adamo <maxadamo@gmail.com>
@albatrossflavour albatrossflavour self-assigned this May 18, 2021
@albatrossflavour albatrossflavour added the bug Something isn't working label May 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants