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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Make "respectGitIgnore" a configurable parameter #30553

Open
BrianMar opened this issue Apr 25, 2024 · 2 comments
Open

[Feature]: Make "respectGitIgnore" a configurable parameter #30553

BrianMar opened this issue Apr 25, 2024 · 2 comments
Labels

Comments

@BrianMar
Copy link

馃殌 Feature Request

Add the ability to override the default value for the currently internal "respectGitIgnore" project value in the config file.

I'm willing to make the change if there is agreement on the feature.

Example

import { defineConfig, devices } from '@playwright/test';

export default defineConfig({
  // Look for test files in the "tests" directory, relative to this configuration file.
  testDir: 'tests',

  // Run all tests in parallel.
  fullyParallel: true,

  // Should the .gitignore file be used to filter out tests
  respectGitIgnore: false
  
  

Motivation

I just spent about 25 hours trying to debug why my tests weren't being run. I generate my test files dynamically, since I'm using Playwright to drive another test runner that is a web app, and with the original implementation in Puppeteer we found that breaking the tests into subgroups was a huge performance win.

Since these test files are dynamically generated, they are added to the .gitignore so that any failure to clean them up (test runner crash) doesn't cause the file to get added to the repo by mistake.

In porting to Playwright, I didn't add an explicit "testDir", mostly because we didn't have one with Playwright.

This combination led to Playwright not seeing the generated test files. And every time I changed the name of the generated files, I'd update the .gitignore, so the problem was bizarre to debug to say the least. It appeared like there was some kind of a cache issue.

@BrianMar
Copy link
Author

There are issues with this picking up "node_modules". However, if I set "testDir" to be the root of my project then I'd be explicitly setting a "testDir" and I'd pick up "node_modules" anyway. So, in that case, I'd likely want to explicitly turn on "respectGitIgnore". I think there's a good case for exposing this.

@BrianMar
Copy link
Author

Here's the Issue where I was debugging this:
#30443

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants