From 1029bc718997d574647f9481e70db2bc7f77eef1 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Fri, 17 Mar 2023 12:29:43 -0400 Subject: [PATCH 1/3] Test local development server (#35657) --- .github/workflows/local-dev.yml | 52 +++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/local-dev.yml diff --git a/.github/workflows/local-dev.yml b/.github/workflows/local-dev.yml new file mode 100644 index 0000000000..a596be0cf4 --- /dev/null +++ b/.github/workflows/local-dev.yml @@ -0,0 +1,52 @@ +name: Local development + +# **What it does**: Can you start the local server like a writer would do? +# **Why we have it**: Our CI is often heavily geared on testing in "production" +# that historically we've been known to break local +# development sometimes. +# **Who does it impact**: Engineers, Contributors. + +on: + merge_group: + pull_request: + +permissions: + contents: read + +jobs: + local-dev: + if: github.repository == 'github/docs-internal' || github.repository == 'github/docs' + runs-on: ${{ fromJSON('["ubuntu-latest", "ubuntu-20.04-xl"]')[github.repository == 'github/docs-internal'] }} + steps: + - name: Check out repo + uses: actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8 + + - uses: ./.github/actions/node-npm-setup + + # Note that we don't check out docs-early-access, Elasticsearch, + # or any remote translations. Nothing fancy here! + + - name: Start server in the background + run: npm start > /tmp/stdout.log 2> /tmp/stderr.log & + + - name: View the home page + run: | + echo "Going to sleep a little to wait for the server to start" + sleep 10 + curl --fail --retry-connrefused --retry 5 http://localhost:4000/ + + - name: Edit a page's .md file and expect it to appear + run: | + # First append anything to the Markdown page + echo "Today's date $(date)" >> content/get-started/quickstart/hello-world.md + + # This pipe to grep will fail if it can't find it in the curl output + curl -L http://localhost:4000/get-started/quickstart/hello-world | grep "Today's date" + + - if: ${{ failure() }} + name: Debug server outputs on errors + run: | + echo "____STDOUT____" + cat /tmp/stdout.log + echo "____STDERR____" + cat /tmp/stderr.log From ecf8c8efa9c52acbd98e7dda3fbd561da06a4d54 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Fri, 17 Mar 2023 12:40:09 -0400 Subject: [PATCH 2/3] Remove happy-path tests of rest pages in rendering/server.js (#35654) --- tests/rendering/server.js | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/tests/rendering/server.js b/tests/rendering/server.js index 465f087091..c3ca7eb3b0 100644 --- a/tests/rendering/server.js +++ b/tests/rendering/server.js @@ -884,15 +884,3 @@ describe('index pages', () => { expect($(`a[href^="${installationLatest}/"]`).length).toBeGreaterThan(0) }) }) - -describe('REST reference pages', () => { - test('view the rest/repos page in English', async () => { - const res = await get('/en/rest/repos') - expect(res.statusCode).toBe(200) - }) - - test('deeper pages in English', async () => { - const res = await get('/en/enterprise-cloud@latest/rest/code-scanning') - expect(res.statusCode).toBe(200) - }) -}) From 6df88d8418e2e26e011e3bd4580781fa64b93a81 Mon Sep 17 00:00:00 2001 From: Rachael Sewell Date: Fri, 17 Mar 2023 09:50:32 -0700 Subject: [PATCH 3/3] Remove debug statement (#35663) --- tests/linting/lint-files.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/linting/lint-files.js b/tests/linting/lint-files.js index 09e5d4ed4b..775320d31c 100644 --- a/tests/linting/lint-files.js +++ b/tests/linting/lint-files.js @@ -250,7 +250,7 @@ const automatedIgnorePaths = ( ) .flat() .filter(Boolean) -console.log(automatedIgnorePaths) + // For each linterIgnore directory, walk the files in the directory and add // to the ignore list. const ignoreMarkdownFilesAbsPath = new Set(