From 0b4682b914cd835f541ade319dfe40a5364a38c8 Mon Sep 17 00:00:00 2001 From: Raghu Simha Date: Thu, 26 Aug 2021 11:31:43 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=8F=97=F0=9F=9A=AE=20Remove=20all=20IE11?= =?UTF-8?q?=20infrastructure=20code=20paths=20(#35341)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/ie-tests.yml | 22 ------ build-system/babel-config/helpers.js | 4 -- build-system/pr-check/ie-tests.js | 35 ---------- build-system/tasks/integration.js | 1 - .../tasks/runtime-test/custom-launchers.js | 4 -- .../tasks/runtime-test/runtime-test-base.js | 2 - build-system/tasks/unit.js | 1 - build-system/test-configs/karma.conf.js | 1 - docs/getting-started-e2e.md | 2 +- docs/testing.md | 1 - package-lock.json | 9 --- package.json | 1 - test/fixtures/images-ie.html | 29 -------- test/integration/builtins/test-amp-img.js | 2 +- test/integration/test-amp-ad-doubleclick.js | 2 +- test/integration/test-shadow-dom-element.js | 68 +++++++++---------- test/integration/test-toggle-display.js | 2 +- testing/test-config.js | 7 +- 18 files changed, 39 insertions(+), 154 deletions(-) delete mode 100644 .github/workflows/ie-tests.yml delete mode 100644 build-system/pr-check/ie-tests.js delete mode 100644 test/fixtures/images-ie.html diff --git a/.github/workflows/ie-tests.yml b/.github/workflows/ie-tests.yml deleted file mode 100644 index e6e2cc5c45b1..000000000000 --- a/.github/workflows/ie-tests.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: IE 11 -on: - push: - branches: - - main - pull_request: - branches: - - main - -jobs: - build_and_test: - if: github.repository == 'ampproject/amphtml' - runs-on: windows-latest - steps: - - name: Checkout Repo - uses: actions/checkout@v2 - with: - fetch-depth: 0 - - name: Install Dependencies - run: bash ./.github/workflows/install_dependencies.sh - - name: Build and Test - run: node build-system/pr-check/ie-tests.js diff --git a/build-system/babel-config/helpers.js b/build-system/babel-config/helpers.js index 7bb5e5fe3035..4d1a6d6a768e 100644 --- a/build-system/babel-config/helpers.js +++ b/build-system/babel-config/helpers.js @@ -101,10 +101,6 @@ function getReplaceGlobalsPlugin() { return; } const possibleNames = ['globalThis', 'self']; - // See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis#browser_compatibility - if (argv.ie) { - possibleNames.shift(); - } const name = possibleNames.find((name) => !scope.getBinding(name)); if (!name) { throw path.buildCodeFrameError( diff --git a/build-system/pr-check/ie-tests.js b/build-system/pr-check/ie-tests.js deleted file mode 100644 index 6ac7b7d70afe..000000000000 --- a/build-system/pr-check/ie-tests.js +++ /dev/null @@ -1,35 +0,0 @@ -'use strict'; - -/** - * @fileoverview Script that builds and tests on IE 11 during CI. - */ - -const {runCiJob} = require('./ci-job'); -const {skipDependentJobs, timedExecOrDie} = require('./utils'); -const {Targets, buildTargetsInclude} = require('./build-targets'); - -const jobName = 'ie-tests.js'; - -/** - * Steps to run during push builds. - */ -function pushBuildWorkflow() { - timedExecOrDie('amp dist --fortesting'); - timedExecOrDie('amp integration --nobuild --minified --ie'); -} - -/** - * Steps to run during PR builds. - */ -function prBuildWorkflow() { - if (buildTargetsInclude(Targets.RUNTIME, Targets.INTEGRATION_TEST)) { - pushBuildWorkflow(); - } else { - skipDependentJobs( - jobName, - 'this PR does not affect the runtime or integration tests' - ); - } -} - -runCiJob(jobName, pushBuildWorkflow, prBuildWorkflow); diff --git a/build-system/tasks/integration.js b/build-system/tasks/integration.js index cc95c407e8ec..cbe9358be651 100644 --- a/build-system/tasks/integration.js +++ b/build-system/tasks/integration.js @@ -62,7 +62,6 @@ integration.flags = { 'files': 'Run tests for specific files', 'grep': 'Run tests that match the pattern', 'headless': 'Run tests in a headless Chrome window', - 'ie': 'Run tests on IE', 'nobuild': 'Skip build step', 'nohelp': 'Silence help messages that are printed prior to test run', 'report': 'Write test result report to a local file', diff --git a/build-system/tasks/runtime-test/custom-launchers.js b/build-system/tasks/runtime-test/custom-launchers.js index eb7bbacf5d55..4ed58fd32838 100644 --- a/build-system/tasks/runtime-test/custom-launchers.js +++ b/build-system/tasks/runtime-test/custom-launchers.js @@ -47,10 +47,6 @@ const customLaunchers = { base: argv.headless ? 'EdgeBetaHeadless' : 'EdgeBeta', flags: ['--no-sandbox', '--disable-gpu', '--disable-dev-shm-usage'], }, - IECustom: { - base: 'IE', - flags: ['-extoff'], - }, }; module.exports = { diff --git a/build-system/tasks/runtime-test/runtime-test-base.js b/build-system/tasks/runtime-test/runtime-test-base.js index 9f4eaafc10bc..f9a209963395 100644 --- a/build-system/tasks/runtime-test/runtime-test-base.js +++ b/build-system/tasks/runtime-test/runtime-test-base.js @@ -110,8 +110,6 @@ class RuntimeTestConfig { ? 'EdgeCustom' : argv.firefox ? 'FirefoxCustom' - : argv.ie - ? 'IECustom' : argv.safari ? 'SafariCustom' : 'ChromeCustom'; diff --git a/build-system/tasks/unit.js b/build-system/tasks/unit.js index 61daa8c34dcd..715ec38728d9 100644 --- a/build-system/tasks/unit.js +++ b/build-system/tasks/unit.js @@ -59,7 +59,6 @@ unit.flags = { 'files': 'Run tests for specific files', 'grep': 'Run tests that match the pattern', 'headless': 'Run tests in a headless Chrome window', - 'ie': 'Runs tests on IE', 'local_changes': 'Run unit tests directly affected by the files changed in the local branch', 'nohelp': 'Silence help messages that are printed prior to test run', diff --git a/build-system/test-configs/karma.conf.js b/build-system/test-configs/karma.conf.js index e20e9aade83f..30fee58aa14c 100644 --- a/build-system/test-configs/karma.conf.js +++ b/build-system/test-configs/karma.conf.js @@ -107,7 +107,6 @@ module.exports = { 'karma-firefox-launcher', 'karma-fixture', 'karma-html2js-preprocessor', - 'karma-ie-launcher', 'karma-structured-json-reporter', 'karma-junit-reporter', 'karma-mocha', diff --git a/docs/getting-started-e2e.md b/docs/getting-started-e2e.md index a9e6a7fe9f81..8acd0d12ca1a 100644 --- a/docs/getting-started-e2e.md +++ b/docs/getting-started-e2e.md @@ -392,7 +392,7 @@ To run the tests that are affected by the changes on your feature branch: amp unit --local_changes ``` -By default, all tests are run on Chrome. Pass one of the following flags to run tests on a different browser: `--firefox`, `--safari`, `--edge`, `--ie`. +By default, all tests are run on Chrome. Pass one of the following flags to run tests on a different browser: `--firefox`, `--safari`, `--edge`. If you need help with fixing failing tests, please ask on the GitHub issue you're working on or reach out to the community as described in [How to get help](#how-to-get-help). diff --git a/docs/testing.md b/docs/testing.md index 19e0e1a8ba2d..a75767ca0cc5 100644 --- a/docs/testing.md +++ b/docs/testing.md @@ -95,7 +95,6 @@ Before running these commands, make sure you have Node.js installed. For instruc | `amp [unit\|integration] --safari` | Runs tests in Safari. | | `amp [unit\|integration] --firefox` | Runs tests in Firefox. | | `amp [unit\|integration] --edge` | Runs tests in Edge. | -| `amp [unit\|integration] --ie` | Runs tests in Internet Explorer. | | `amp [unit\|integration] --files=` | Runs specific test files. | | `amp [unit\|integration] --testnames` | Lists the name of each test being run, and prints a summary at the end. | | `amp serve` | Serves content from the repository root at http://localhost:8000/. Examples live in http://localhost:8000/examples/. Serves unminified binaries by default. | diff --git a/package-lock.json b/package-lock.json index 3cc5cb439917..b84bf37b8536 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16197,15 +16197,6 @@ "integrity": "sha1-/Ant8Eu+K7bu6boZaPgmtziAIL0=", "dev": true }, - "karma-ie-launcher": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/karma-ie-launcher/-/karma-ie-launcher-1.0.0.tgz", - "integrity": "sha1-SXmGhCxJAZA0bNifVJTKmDDG1Zw=", - "dev": true, - "requires": { - "lodash": "^4.6.1" - } - }, "karma-junit-reporter": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/karma-junit-reporter/-/karma-junit-reporter-2.0.1.tgz", diff --git a/package.json b/package.json index d8e0aa39f839..97a6fdecd07f 100644 --- a/package.json +++ b/package.json @@ -136,7 +136,6 @@ "karma-firefox-launcher": "2.1.1", "karma-fixture": "0.2.6", "karma-html2js-preprocessor": "1.1.0", - "karma-ie-launcher": "1.0.0", "karma-junit-reporter": "2.0.1", "karma-mocha": "2.0.1", "karma-mocha-reporter": "2.2.5", diff --git a/test/fixtures/images-ie.html b/test/fixtures/images-ie.html deleted file mode 100644 index 05c2f5032555..000000000000 --- a/test/fixtures/images-ie.html +++ /dev/null @@ -1,29 +0,0 @@ - - - - - AMP #0 - - - - - - - -

AMP #0

-

Srcset

- - -

Intrinsic

- - - diff --git a/test/integration/builtins/test-amp-img.js b/test/integration/builtins/test-amp-img.js index 6bf6d80acdd7..0a6cb6e4ab8f 100644 --- a/test/integration/builtins/test-amp-img.js +++ b/test/integration/builtins/test-amp-img.js @@ -4,7 +4,7 @@ import {createFixtureIframe, expectBodyToBecomeVisible} from '#testing/iframe'; import {createCustomEvent} from '../../../src/event-helper'; -describes.sandboxed.configure().run('Rendering of amp-img', {}, () => { +describes.sandboxed('Rendering of amp-img', {}, () => { const timeout = window.ampTestRuntimeConfig.mochaTimeout; let fixture; diff --git a/test/integration/test-amp-ad-doubleclick.js b/test/integration/test-amp-ad-doubleclick.js index 7b280ee5c19e..4aee7ced55e6 100644 --- a/test/integration/test-amp-ad-doubleclick.js +++ b/test/integration/test-amp-ad-doubleclick.js @@ -1,6 +1,6 @@ import {createFixtureIframe, poll, pollForLayout} from '#testing/iframe'; -describes.sandboxed.configure().run('Rendering of one ad', {}, () => { +describes.sandboxed('Rendering of one ad', {}, () => { let fixture; let beforeHref; diff --git a/test/integration/test-shadow-dom-element.js b/test/integration/test-shadow-dom-element.js index cd8b592ff253..d89cd129f914 100644 --- a/test/integration/test-shadow-dom-element.js +++ b/test/integration/test-shadow-dom-element.js @@ -4,46 +4,45 @@ import {toggleExperiment} from '#experiments'; import {createFixtureIframe} from '#testing/iframe'; -describes.sandboxed - .configure() - .run('Render a shadow-dom based element', {}, () => { - let fixture; - - beforeEach(async () => { - fixture = await createFixtureIframe( - 'test/fixtures/shadow-dom-element.html', - 3000 - ); - toggleExperiment(fixture.win, 'bento', true, true); - }); +describes.sandboxed('Render a shadow-dom based element', {}, () => { + let fixture; + + beforeEach(async () => { + fixture = await createFixtureIframe( + 'test/fixtures/shadow-dom-element.html', + 3000 + ); + toggleExperiment(fixture.win, 'bento', true, true); + }); - it('should create shadow root', async () => { - const carousel = fixture.doc.querySelector('amp-base-carousel'); - await whenUpgradedToCustomElement(carousel); - await carousel.whenBuilt(); - await new Promise(setTimeout); + it('should create shadow root', async () => { + const carousel = fixture.doc.querySelector('amp-base-carousel'); + await whenUpgradedToCustomElement(carousel); + await carousel.whenBuilt(); + await new Promise(setTimeout); - expect(carousel.shadowRoot).to.exist; + expect(carousel.shadowRoot).to.exist; - const slides = carousel.querySelectorAll('amp-img'); - expect(slides).to.have.length(2); + const slides = carousel.querySelectorAll('amp-img'); + expect(slides).to.have.length(2); - const slots = carousel.shadowRoot - .querySelector('c') - .querySelectorAll('slot'); - expect(slots).to.have.length(2); + const slots = carousel.shadowRoot + .querySelector('c') + .querySelectorAll('slot'); + expect(slots).to.have.length(2); - expect(slides[0].assignedSlot).to.equal(slots[0]); - expect(slides[1].assignedSlot).to.equal(slots[1]); - expect(slots[0].assignedNodes()[0]).to.equal(slides[0]); - expect(slots[1].assignedNodes()[0]).to.equal(slides[1]); - expect(slots[0].getRootNode()).to.equal(carousel.shadowRoot); - }); + expect(slides[0].assignedSlot).to.equal(slots[0]); + expect(slides[1].assignedSlot).to.equal(slots[1]); + expect(slots[0].assignedNodes()[0]).to.equal(slides[0]); + expect(slots[1].assignedNodes()[0]).to.equal(slides[1]); + expect(slots[0].getRootNode()).to.equal(carousel.shadowRoot); }); +}); -describes.sandboxed - .configure() - .run('Render a shadow-dom based element, force polyfill', {}, () => { +describes.sandboxed( + 'Render a shadow-dom based element, force polyfill', + {}, + () => { let fixture; beforeEach(async () => { @@ -76,4 +75,5 @@ describes.sandboxed expect(slots[1].assignedNodes()[0]).to.equal(slides[1]); expect(slots[0].getRootNode()).to.equal(carousel.shadowRoot); }); - }); + } +); diff --git a/test/integration/test-toggle-display.js b/test/integration/test-toggle-display.js index 9445a3992f5d..588e0842b890 100644 --- a/test/integration/test-toggle-display.js +++ b/test/integration/test-toggle-display.js @@ -2,7 +2,7 @@ import {setInitialDisplay, toggle} from '#core/dom/style'; import {BrowserController} from '#testing/test-helper'; -describes.integration.configure().run( +describes.integration( 'toggle display helper', { body: '', diff --git a/testing/test-config.js b/testing/test-config.js index bb6660b4d525..ddcb68991b1c 100644 --- a/testing/test-config.js +++ b/testing/test-config.js @@ -7,7 +7,7 @@ import {Services} from '#service'; * using describes.configure(), describe.configure(), or it.configure(). * * Example usage: - * 1. describes.configure().skipChrome().run(name, spec, function); + * 1. describes.configure().skipChrome().skipIos().run(name, spec, function); * 2. describe.configure().skipFirefox().skipSafari().run(name, function); * 3. it.configure().skipEdge().run(name, function); */ @@ -43,11 +43,6 @@ export class TestConfig { this.runOnFirefox = this.platform.isFirefox.bind(this.platform); this.runOnSafari = this.platform.isSafari.bind(this.platform); this.runOnIos = this.platform.isIos.bind(this.platform); - - /** - * By default, IE is skipped. Individual tests may opt in. - */ - this.skip(() => /Trident|MSIE|IEMobile/i.test(window.navigator.userAgent)); } skipModuleBuild() {