Skip to content

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

@corbob

Description

@corbob

👻 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions