Unverified Commit 239471c8 authored by Hendrik Liebau's avatar Hendrik Liebau Committed by GitHub

[ci] Exclude `test/production` from deploy tests (#88763)

parent 97532172
...@@ -17,7 +17,7 @@ export default async function getChangedTests() { ...@@ -17,7 +17,7 @@ export default async function getChangedTests() {
if (isCanary) { if (isCanary) {
console.log(`Skipping flake detection for canary`) console.log(`Skipping flake detection for canary`)
return { devTests: [], prodTests: [] } return { devTests: [], prodTests: [], deployTests: [] }
} }
const diffRevision = await getDiffRevision() const diffRevision = await getDiffRevision()
...@@ -44,6 +44,7 @@ export default async function getChangedTests() { ...@@ -44,6 +44,7 @@ export default async function getChangedTests() {
// and if any fail it's flakey // and if any fail it's flakey
const devTests = [] const devTests = []
const prodTests = [] const prodTests = []
const deployTests = []
for (let file of changedFiles) { for (let file of changedFiles) {
// normalize slashes // normalize slashes
...@@ -54,10 +55,11 @@ export default async function getChangedTests() { ...@@ -54,10 +55,11 @@ export default async function getChangedTests() {
.catch(() => false) .catch(() => false)
if (fileExists && file.match(/^test\/.*?\.test\.(js|ts|tsx)$/)) { if (fileExists && file.match(/^test\/.*?\.test\.(js|ts|tsx)$/)) {
if ( if (file.startsWith('test/e2e/')) {
file.startsWith('test/e2e/') || devTests.push(file)
file.startsWith('test/integration/') prodTests.push(file)
) { deployTests.push(file)
} else if (file.startsWith('test/integration/')) {
devTests.push(file) devTests.push(file)
prodTests.push(file) prodTests.push(file)
} else if (file.startsWith('test/prod')) { } else if (file.startsWith('test/prod')) {
...@@ -74,11 +76,12 @@ export default async function getChangedTests() { ...@@ -74,11 +76,12 @@ export default async function getChangedTests() {
{ {
devTests, devTests,
prodTests, prodTests,
deployTests,
}, },
null, null,
2 2
) )
) )
return { devTests, prodTests, commitSha } return { devTests, prodTests, deployTests, commitSha }
} }
...@@ -41,9 +41,15 @@ async function main() { ...@@ -41,9 +41,15 @@ async function main() {
/** @type import('execa').Options */ /** @type import('execa').Options */
const EXECA_OPTS_STDIO = { ...EXECA_OPTS, stdio: 'inherit' } const EXECA_OPTS_STDIO = { ...EXECA_OPTS, stdio: 'inherit' }
const { devTests, prodTests, commitSha } = await getChangedTests() const { devTests, prodTests, deployTests, commitSha } =
await getChangedTests()
let currentTests = testMode === 'dev' ? devTests : prodTests let currentTests =
testMode === 'dev'
? devTests
: testMode === 'deploy'
? deployTests
: prodTests
/** /**
@type {Array<string[]>} @type {Array<string[]>}
......
...@@ -46,10 +46,7 @@ ...@@ -46,10 +46,7 @@
} }
}, },
"rules": { "rules": {
"include": [ "include": ["test/e2e/**/*.test.{t,j}s{,x}"],
"test/e2e/**/*.test.{t,j}s{,x}",
"test/production/**/*.test.{t,j}s{,x}"
],
"exclude": [ "exclude": [
"test/e2e/cancel-request/stream-cancel.test.ts", "test/e2e/cancel-request/stream-cancel.test.ts",
"test/e2e/new-link-behavior/material-ui.test.ts", "test/e2e/new-link-behavior/material-ui.test.ts",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment