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

When files are copied to SUT any existing files are left #95

Open
corbob opened this issue Nov 21, 2022 · 0 comments
Open

When files are copied to SUT any existing files are left #95

corbob opened this issue Nov 21, 2022 · 0 comments

Comments

@corbob
Copy link
Contributor

corbob commented Nov 21, 2022

👻 Brief Description

While I am working on my test suites, it is not uncommon for me to run multiple kitchen verify commands in succession with changes between them. The issue I have encountered is that if I rename a file or remove a file, the original file is left on the SUT and therefore gets run as part of the kitchen verify call.

Version

1.2.0

Environment

  • Test Kitchen (v3.3.2)
  • macOS 12.6.1
  • kitchen-pester 1.2.0

Scenario

See Description.

Steps to Reproduce

Using this repository for reproduction:

  1. Edit ./tests/integration/pester/default.tests.ps1 to make a test fail.
  2. Run kitchen verify (Note: you may need to update the .kitchen.yml file to point to StefanScherer/windows_2016 instead of stefanscherer/windows_2016)
  3. Note that your test failed.
  4. Run git restore . to restore the file and remove the failing test
  5. Rename ./tests/integration/pester/default.tests.ps1 to be something else (I named mine ./tests/integration/pester/my.tests.ps1)
  6. Run kitchen verify
  7. Note that your new file runs fine, but the failing test from default.tests.ps1 is still there and failing even though it's no longer in your tests on the host...

Expected Result

Ideally any files that do not exist on your host should not exist on the SUT.

Actual Result

Files that were previously on your host and have been moved/deleted still exist on the SUT.

➕ Additional context

The scenario where this happens is restricted to just while building the tests. When running them you won't typically be moving the files around and running a verify without destroying the kitchen first.

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

1 participant