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

locally created screenshots and videos in examples are queued for commit #676

Closed
MikeMcC399 opened this issue Dec 16, 2022 · 1 comment
Closed

Comments

@MikeMcC399
Copy link
Collaborator

MikeMcC399 commented Dec 16, 2022

Problem description

  1. If screenshots or videos are created locally in the examples directories then they are added to git differences for a potential commit

  2. Due to the above issue, screenshots have been committed to examples/v10/chrome/cypress/screenshots

Steps to reproduce the issue

In a local clone of the repository, execute:

cd examples/v10/quiet
npm ci
npx cypress run --browser chrome
git status

Note the output

$ git status
On branch master
Your branch is up to date with 'origin/master'.

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        cypress/screenshots/
        cypress/videos/

nothing added to commit but untracked files present (use "git add" to track)

Expected behavior

Screenshots and videos resulting from Cypress test runs locally should not be committed to the repository.

Analysis

The entries for videos and screenshots do not match the actual locations where videos and screenshots are stored

examples/*/cypress/videos
examples/*/cypress/screenshots

compare to the actual locations from the steps to reproduce:

examples/v10/quiet/cypress/screenshots
examples/v10/quiet/cypress/videos

* matches anything except a slash, so there is no match. (See reference documentation https://git-scm.com/docs/gitignore.)

The problem would have started to happen as the existing v9 tests were moved and an extra level of directories was introduced in 5d0fb97.

Suggested Fix


For .gitignore ...

  1. Change
examples/*/cypress/videos
examples/*/cypress/screenshots

to

examples/**/cypress/videos
examples/**/cypress/screenshots

in order to match /v10/quiet/ for example.

  1. Add
examples/**/cypress/downloads

in case any future examples cause this temporary directory to be created.

(See Cypress documentation: Folders / Files) for list of temporary file locations.


Remove the incorrectly committed screenshots from the repository:

examples/v10/chrome/cypress/screenshots

@MikeMcC399
Copy link
Collaborator Author

MikeMcC399 commented Dec 16, 2022

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