add new conditional test runs helper

This commit is contained in:
Sarah Schneider 2020-12-08 11:36:53 -05:00
Родитель 4b1988d8a8
Коммит 117bd5fcb8
3 изменённых файлов: 12 добавлений и 7 удалений

Просмотреть файл

@ -0,0 +1,9 @@
const runningActionsOnInternalRepo = process.env.GITHUB_ACTIONS === 'true' && process.env.GITHUB_REPOSITORY === 'github/docs-internal'
const testViaActionsOnly = runningActionsOnInternalRepo ? test : test.skip
const describeViaActionsOnly = runningActionsOnInternalRepo ? describe : describe.skip
module.exports = {
testViaActionsOnly,
describeViaActionsOnly
}

Просмотреть файл

@ -1,12 +1,11 @@
const lodash = require('lodash') const lodash = require('lodash')
const enterpriseServerReleases = require('../../lib/enterprise-server-releases') const enterpriseServerReleases = require('../../lib/enterprise-server-releases')
const { get, getDOM, head } = require('../helpers/supertest') const { get, getDOM, head } = require('../helpers/supertest')
const { describeViaActionsOnly } = require('../helpers/conditional-runs')
const path = require('path') const path = require('path')
const nonEnterpriseDefaultVersion = require('../../lib/non-enterprise-default-version') const nonEnterpriseDefaultVersion = require('../../lib/non-enterprise-default-version')
const { loadPages } = require('../../lib/pages') const { loadPages } = require('../../lib/pages')
const describeInternalOnly = process.env.GITHUB_REPOSITORY === 'github/docs-internal' ? describe : describe.skip
describe('server', () => { describe('server', () => {
jest.setTimeout(60 * 1000) jest.setTimeout(60 * 1000)
@ -358,7 +357,7 @@ describe('server', () => {
}) })
}) })
describeInternalOnly('Early Access articles', () => { describeViaActionsOnly('Early Access articles', () => {
let hiddenPageHrefs, hiddenPages let hiddenPageHrefs, hiddenPages
beforeAll(async (done) => { beforeAll(async (done) => {

Просмотреть файл

@ -1,9 +1,6 @@
const fs = require('fs') const fs = require('fs')
const path = require('path') const path = require('path')
const { testViaActionsOnly } = require('../helpers/conditional-runs')
const { GITHUB_ACTIONS, GITHUB_REPOSITORY } = process.env
const runningActionsOnInternalRepo = GITHUB_ACTIONS === 'true' && GITHUB_REPOSITORY === 'github/docs-internal'
const testViaActionsOnly = runningActionsOnInternalRepo ? test : test.skip
describe('cloning early-access', () => { describe('cloning early-access', () => {
testViaActionsOnly('the content directory exists', async () => { testViaActionsOnly('the content directory exists', async () => {