Commit graph

19 commits

Author SHA1 Message Date
Vasundhara Jagdale
8ee7bc946d
CHEF-642 Fix for inspec exec fails with git fetcher if current directory does not have .git directory (#6626)
* Functional Test to verify git fetcher able to work in a directory where git is not initialized or does not contain the .git directory

Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>

* Fix: If git branch, tag or reference information is not given it should clone the repo and checkout the default HEAD

Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>

* Remove the logic to find default branch in case of branch, tag or ref is not provided as it's not required logically as we will be cloning the and checkout the default HEAD

Signed-off-by: Vasu1105 <vasundhara.jagdale@progress.com>

* This is a temporary change to make verify test working on this PR. Revert once the work is done for the git fetcher fix

Signed-off-by: Vasu1105 <vasundhara.jagdale@progress.com>

* Unit Test: Fix unit test

Signed-off-by: Vasu1105 <vasundhara.jagdale@progress.com>

* Verifies the git url before creating cache_key, if given relative path does not exist make sure it deletes the cache directory created to copy the cloned repo. It raises error if any git command fails

Signed-off-by: Vasu1105 <vasundhara.jagdale@progress.com>

* Reverted verify git repo url call from cache_key as cache_key and shifted that to resolve_ref which is already raising the error in case of git ls remote command fails

Signed-off-by: Vasu1105 <vasundhara.jagdale@progress.com>

* Unit test to cover the changes done for resolve_ref when branch, tag or ref is not given and
unit test for invalid git repo

Signed-off-by: Vasu1105 <vasundhara.jagdale@progress.com>

---------

Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
Signed-off-by: Vasu1105 <vasundhara.jagdale@progress.com>
2023-08-31 20:06:24 +05:30
Vasu1105
ab01652ee2 CFINSPEC-137: Fix the failing test and lint for the --target-option deprication changes
Signed-off-by: Vasu1105 <vasundhara.jagdale@chef.io>
2022-03-11 15:47:50 +05:30
Nikita Mathur
628d1561f9 Unnecessary white spaces removed from git fetcher testing files
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2021-03-23 16:42:52 +05:30
Nikita Mathur
d9bb2649e6 Code refactoring changes for fix #5233
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2021-03-23 16:20:47 +05:30
Nikita Mathur
d673e840a3 Fix for executing git profiles with default branch not just master
Signed-off-by: Nikita Mathur <nikita.mathur@chef.io>
2021-03-23 16:20:47 +05:30
Nick Schwaderer
1a1205c729 Fixes many of the old skip_windows instances
Signed-off-by: Nick Schwaderer <nschwaderer@chef.io>
2020-09-14 15:55:10 +01:00
Nick Schwaderer
480567564b Review skip_windows violations and expiration
We have 72 `skip_windows` that need addressing. This PR removes
confirmed instances where the tests now work on windows. It also marks
tests with a comment where they are confirmed to still break. Unmarked
instances still need review.

It also updates the `skip_windows` expiration date.

72 `skip_windows` needing resolution OR alternative documentation upon investigation

Signed-off-by: Nick Schwaderer <nschwaderer@chef.io>
2020-07-02 11:53:38 +01:00
Ryan Davis
b1c2af209b Corresponding fixes for the move from test/unit/mock to test/fixtures.
Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-11-08 19:20:12 -08:00
Ryan Davis
d201d1fbc2 Fixed the rest of the minitest deprecations by removing FuncTestRunResult.
Folded the json & other payloads into plain ivars on the test.
Found and removed some unused code while I was there.

Fixes #4533.

Signed-off-by: Ryan Davis <zenspider@chef.io>
2019-10-22 12:15:28 -07:00
Clinton Wolfe
88898ce7a9 Linting
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-07-30 13:42:24 -04:00
Clinton Wolfe
f00e741999 PR feedback
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-07-30 13:38:02 -04:00
Clinton Wolfe
c03862fe7b Code climate updates
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-07-30 13:38:02 -04:00
Clinton Wolfe
4f6d296a22 The error case in which the path does not exist
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-07-30 13:38:02 -04:00
Clinton Wolfe
860d21a370 Test for ./
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-07-30 13:38:02 -04:00
Clinton Wolfe
31bedf7b37 Empty-string edge case
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-07-30 13:38:02 -04:00
Clinton Wolfe
fab58b590e Combo relative test in place
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-07-30 13:38:02 -04:00
Clinton Wolfe
e9ef8e25a3 Deep dependency works
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-07-30 13:38:02 -04:00
Clinton Wolfe
80241ec971 Passing basic test harness
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-07-30 13:38:02 -04:00
Clinton Wolfe
aa81012013 Rework tests to be fixture-based, not generated per-run
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
2019-07-30 13:38:02 -04:00