diff --git a/.github/workflows/validate-tests.yml b/.github/workflows/validate-tests.yml new file mode 100644 index 0000000000..16b4be49a7 --- /dev/null +++ b/.github/workflows/validate-tests.yml @@ -0,0 +1,33 @@ +name: Validate Tests + +on: + pull_request: + push: + branches: + - main + - 'release-*' + workflow_dispatch: + +jobs: + validate: + name: Validate + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + + - name: Setup JS + uses: ./.github/actions/setup-js + + - name: yarn gentest-validate + run: yarn gentest-validate + + - name: yarn gentest + run: yarn gentest -h + + - name: Check for modified tests + run: | + if [[ -n $(git status -s) ]]; then + git status -s + echo "yarn gentest modified these tests. Please run yarn gentest to resolve." + exit 1 + fi diff --git a/gentest/gentest-driver.ts b/gentest/gentest-driver.ts index 4192b38105..ff61686356 100644 --- a/gentest/gentest-driver.ts +++ b/gentest/gentest-driver.ts @@ -33,6 +33,7 @@ process.chdir(path.dirname(process.argv[1])); const argv = minimist(process.argv.slice(2)); const specificFixture = argv.f || argv.fixture; const suspend = argv.s || argv.suspend; +const headless = argv.h || argv.headless; let fixtures = await fs.readdir('./fixtures'); try { @@ -52,6 +53,7 @@ options.addArguments( '--window-position=0,0', '--hide-scrollbars', ); +headless && options.addArguments('--headless'); options.setLoggingPrefs({ browser: 'ALL', performance: 'ALL',