inspec/test/unit
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
..
bundles/inspec-supermarket First pass at cleaning deprecations for old minitest/spec-style tests. 2019-10-03 13:45:19 -07:00
dependencies First pass at cleaning deprecations for old minitest/spec-style tests. 2019-10-03 13:45:19 -07:00
dsl Singularize the fetchers directory name 2019-11-22 09:57:28 -05:00
fetchers CHEF-642 Fix for inspec exec fails with git fetcher if current directory does not have .git directory (#6626) 2023-08-31 20:06:24 +05:30
inputs Added new pattern option, fix for input options on dsl and functional test cases for input options 2021-04-21 12:33:54 +05:30
matchers resolves inspec/inspec#6042 (#6043) (#6278) 2022-10-20 14:06:01 -04:00
plugin CHEF-2438 Add train-kubernetes to inspec gemspec (#6512) (#43) 2023-05-17 20:33:27 -04:00
profiles Upgraded mock ubuntu test from 20.04 to 22.04 (#6456) 2023-02-24 16:00:19 +05:30
reporters Missing changes from main (#6564) 2023-08-14 09:15:07 -04:00
resources For #6493 : Add postgres_session support for custom port with a socket connection (#6494) (#40) 2023-07-04 16:05:25 -04:00
schema Clean up schema PR. 2020-02-05 17:06:55 -08:00
source_readers First pass at cleaning deprecations for old minitest/spec-style tests. 2019-10-03 13:45:19 -07:00
utils Adds test for licensing_config (#57) 2023-07-06 21:24:05 -04:00
backend_test.rb Removed metaprogramming in Inspec::Backend. 2020-02-03 14:41:37 -08:00
base_cli_test.rb First pass at cleaning deprecations for old minitest/spec-style tests. 2019-10-03 13:45:19 -07:00
cached_fetcher_test.rb These tests probably never passed. 2019-07-29 11:42:30 -07:00
config_test.rb Improve programmatic plugin configuration 2021-01-27 13:31:12 +01:00
dependency_loader_test.rb CFINSPEC-13: Adds code to handle all kinds of version constraint and improved installed gem search logic for the version constraint. 2022-03-04 00:34:46 -05:00
feature_test.rb Feature Config File and Logger Support (#6260) 2022-10-19 19:17:56 +05:30
file_provider_test.rb Apply chefstyle -a, and manually remove duplicate requires 2020-12-21 13:25:04 -05:00
impact_test.rb First pass at cleaning deprecations for old minitest/spec-style tests. 2019-10-03 13:45:19 -07:00
json_profile_summary_test.rb Stores output of inspec json to archive and artifact 2020-05-20 12:34:17 +01:00
resource_test.rb Revert "Revert "CFINSPEC-70 Added resource_id attribute for the custom resources in the base class"" 2022-03-04 09:15:52 -05:00
runner_test.rb Licensing - Integrates Software Entitlement (#13) 2023-03-27 10:26:35 -04:00
shell_detector_test.rb Please stop warning about mocha. 2020-02-03 14:49:47 -08:00
ui_test.rb First pass at cleaning deprecations for old minitest/spec-style tests. 2019-10-03 13:45:19 -07:00