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

Keep test files meant for scripted tests within a template #774

Merged
merged 1 commit into from
Mar 4, 2023

Conversation

mkurz
Copy link
Contributor

@mkurz mkurz commented Mar 3, 2023

Fixes #394

To test this I ran sbt new sbt/sbt-autoplugin.g8. Like reported in #394 the src/sbt-test/sbt-foo-bar/simple/test was missing.

Now I did

  1. To simulate this PR I added to the .gitignore file:
test
!**/sbt-test/**/test
!test/
  1. created the file src/sbt-test/sbt-foo-bar/simple/test (the one that should not be ignored)
  2. More testing by adding a sbt-test folder to the root dir containing various test files in various levels and a test file in the root folder and in a directory e.g scr/main/.

Now running:

$ git add .
$ git status 
On branch main
Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        modified:   .gitignore
        new file:   sbt-test/foo/bar/test
        new file:   sbt-test/foo/test
        new file:   sbt-test/test
        new file:   src/sbt-test/sbt-foo-bar/simple/test

It's exactly what I wanted to see. All test files containted within a sbt-test folder get added, no matter which level they are in and no matter at which level the sbt-test folder is. All other test files get ignored.

Copy link
Member

@eed3si9n eed3si9n left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@eed3si9n eed3si9n merged commit defe178 into foundweekends:develop Mar 4, 2023
@mkurz mkurz deleted the keep-scripted-test-files branch March 4, 2023 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

sbt-scripted tests are ignored
2 participants