Skip to content
This repository has been archived by the owner on Jun 19, 2020. It is now read-only.

(FACT-2542) Refactored unit tests for facter.rb #444

Closed
wants to merge 15 commits into from

Conversation

Filipovici-Andrei
Copy link
Contributor

This is just an example of how refactoring can be done. I final solution must be accepted by all team members

@Filipovici-Andrei Filipovici-Andrei requested review from a team April 13, 2020 11:09
@Filipovici-Andrei Filipovici-Andrei changed the title (FACT-2542) Refact unit tests for facter.rb (FACT-2542) Refactored unit tests for facter.rb Apr 13, 2020
BogdanIrimie
BogdanIrimie previously approved these changes Apr 28, 2020
Filipovici-Andrei and others added 9 commits April 28, 2020 18:05
…455)

* (FACT-2559) added check if Facter.debugging? is loaded
* (FACT-2559) Fixed some tests leakage in logger_spec.rb
Added tests for when Facter is not fully loaded
* (FACT-2559) Created a context for when debugging is set to false
* (FACT-2559) refactored debugging_active?
* (FACT-2559) refactored file_helper.rb and file_helper_spec.rb
Added in logger_spec.rb removal of multi_logger_double
Co-authored-by: Andrei Filipovici <andrei.filipovici@andreis-mbp.eth.tsr.corp.puppet.net>
Co-authored-by: Bogdan Irimie <bogdan.irimie@puppet.com>
…443)

* (FACT-2564) Add support for zpool_featureflags and fix zpool_version
This allows facter-ng to return the same facts as facter 3.x.
This changes took place in facter 3.8.0:
puppetlabs/facter#1597

* (FACT-2564) Move zpool feature flags in a let statement
Co-authored-by: Bogdan Irimie <bogdan.irimie@puppet.com>
Co-authored-by: Bogdan Irimie <bogdan.irimie@puppet.com>
* (FACT-2552) Add Solaris processors facts
* (FACT-2552) Fix rspec failure
* (FACT-2485) Implement '--list-cache-groups' option
* (FACT-2486) Add facts cache
…ving os.release (#466)

* (FACT-2565) fixed fact for when release does not have minor version
refactored unit tests
* (FACT-2565) when fact throws exception, it's value is not stored and the failure is logged
* (FACT-2565) simplified condition for release minor
* (FACT-2565) refactore release hash
* (FACT-2555) If no module with the OS name was discovered, log a debug message instead of an error message.
* (FACT-2555) Add OsHierarchy Class and json with Os hierarchy definition.
* (FACT-2555) Reproduce existing hierarchy in os_hierarchy.json
* (FACT-2555) Use OsHierarchy in OsDetector. Rubocop fixes.
* (FACT-2555) If the distribution cannot be detected, default to linux
* (FACT-2555) Add comments.
* (FACT-2555) Add mock for OsHierarchy in OsDetector tests.
* (FACT-2555) Add test for fallback to linux in case no distribution is detected.
* (FACT-2555) Refactor OsDetector tests.
* (FACT-2555) Try to use family to detect os placement in hierarchy.
* (FACT-2555) Add mechanism for using os family if no hierarchy can be detected for OS.
* (FACT-2555) Add tests for os_hierarchy.
* (FACT-2555) Small refactoring of os detector.
* (FACT-2555) Add test for family.
* (FACT-2555) Force mount-point data to UTF-8 as it might be ASCI in some cases (e.g. when time machine is running on macOS)
* (FACT-2555) Move conversion to UTF-8 in helper.
* (FACT-2555) Add test for filesusyem_helper. Fix existing tests.
* (FACT-2555) Fix os hierarchy for intermediary nodes. Add tests for intermediary and root nodes.
* (FACT-2555) Address PR comments.
* (FACT-2555) Move the action we are testing in the block.
* (FACT-2555) Improve error handling for os_hierarchy.
* Revert "(FACT-2555) Add test for filesusyem_helper. Fix existing tests."
This reverts commit 0b220cd.
* Revert "(FACT-2555) Move conversion to UTF-8 in helper."

This reverts commit a218ac7.

* Revert "(FACT-2555) Force mount-point data to UTF-8 as it might be ASCI in some cases (e.g. when time machine is running on macOS)"
This reverts commit 8cdf10d.

* (FACT-2555) Add test for cases that throw exceptions.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
6 participants