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

inspec 5.22.36 uses wrong tests from github #6980

Open
Gary-Armstrong opened this issue Feb 27, 2024 · 1 comment
Open

inspec 5.22.36 uses wrong tests from github #6980

Gary-Armstrong opened this issue Feb 27, 2024 · 1 comment

Comments

@Gary-Armstrong
Copy link

I have Inspec tests in a git repo. In the root of the repo dir, I can run the current set of tests from local.

cinc-auditor exec --sudo -i ~/.ssh/id_ed25519 -t ssh://[email protected] .

The tests I wrote are executed as expected.
The git log:

* commit c3b6045abe0e8c592fb9f1b819b0fdb4a6b5d6a7 (HEAD -> master, origin/master)
| Author: Me Money <[email protected]>
| Date:   Mon Feb 26 13:40:11 2024 -0500

Awesome. This matches what I see in GitHub, and what I see when I clone this repo into another location. The remotes:

origin	[email protected]:krusty/inspec-money.git (fetch)
origin	[email protected]:krusty/inspec-money.git (push)

When I do this:

cinc-auditor exec --sudo -i ~/.ssh/id_ed25519 -t ssh://[email protected] [email protected]:krusty/inspec-money.git

Some tests are executed but they are not the ones from HEAD. This also happened in Test Kitchen. What's going on here?

Describe the problem

Inspec is expected to execute tests from HEAD commit. Instead, it is executing tests from another commit or other location.

Possible Solution

I saw this originally in Test Kitchen but after some troubleshooting, I determined this happens with Inspec CLI. However, when I did this in TK

kitchen verify me-first-dollar -l debug

using

verifier:
  name: inspec
  load_plugins: false
  backend_cache: false
  inspec_tests:
  - name: inspec_money
      git: ssh://[email protected]/krusty/inspec-money.git

The output showed the correct commit, and then it executed the correct tests where on previous attempts it ran the wrong ones. I then ran kitchen verify again without the debug flag, and it used the correct tests.

I do not know where inspec is pulling the "bad" tests from.

@Vasu1105
Copy link
Contributor

@Gary-Armstrong Is this profile has public access on git ?

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

No branches or pull requests

2 participants