Skip to content

Commit

Permalink
Remove polyfills from loaders and add test (#275)
Browse files Browse the repository at this point in the history
* remove polyfills from loaders and add test

* add polyfill test and supported test paths

* get supported browsers from sauce

* remove sauce fetch from test-server

* update browsers-supported.json

* fix merge conflicts

* fix tests for safari and ios

* remove build caching from testing

* remove build caching from testing

* fix get-failed-tests to pass or fail at end

* add pre-commit

* create polyfill builds

* update process for polyfill testing with built files and browser tests
  • Loading branch information
metal-messiah authored Oct 4, 2022
1 parent e62b44f commit 45bebf2
Show file tree
Hide file tree
Showing 34 changed files with 429 additions and 489 deletions.
221 changes: 87 additions & 134 deletions .github/workflows/tests-polyfill.yml

Large diffs are not rendered by default.

167 changes: 60 additions & 107 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,75 +6,51 @@ on:
workflow_dispatch:

jobs:
cache-build:
if: contains(fromJson('["workflow_dispatch"]'), github.event_name) || contains(github.event.pull_request.labels.*.name, 'safe to test')
timeout-minutes: 30
name: Build
runs-on: ubuntu-latest
container: node:14
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 14

- name: install
run: npm ci --cache ./.npm

- run: npm run build:all
- uses: actions/cache@v2
id: restore-build
with:
path: ./*
key: ${{ github.sha }}
lint:
if: contains(fromJson('["workflow_dispatch"]'), github.event_name) || contains(github.event.pull_request.labels.*.name, 'safe to test')
timeout-minutes: 30
runs-on: ubuntu-latest
container: node:14
needs: [cache-build]

steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: install
run: npm ci --cache ./.npm

- uses: actions/cache@v2
id: restore-build
with:
path: ./*
key: ${{ github.sha }}

- name: build
run: npm run build:all

- name: lint
run: npm run lint
package-tests:
if: contains(fromJson('["workflow_dispatch"]'), github.event_name) || contains(github.event.pull_request.labels.*.name, 'safe to test')
timeout-minutes: 30
runs-on: ubuntu-latest
container: node:14
needs: [cache-build]

steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: install
run: npm ci --cache ./.npm

- uses: actions/cache@v2
id: restore-build
with:
path: ./*
key: ${{ github.sha }}

- name: build
run: npm run build:all

- name: test
run: npm run packages:test
chrome-functional:
if: contains(fromJson('["workflow_dispatch"]'), github.event_name) || contains(github.event.pull_request.labels.*.name, 'safe to test')
timeout-minutes: 30
continue-on-error: true
runs-on: ubuntu-latest
container: node:14
needs: [cache-build]

env:
NEWRELIC_ENVIRONMENT: ci
JIL_SAUCE_LABS_USERNAME: ${{ secrets.JIL_SAUCE_LABS_USERNAME }}
Expand All @@ -89,20 +65,18 @@ jobs:
- name: install
run: npm ci --cache ./.npm

- uses: actions/cache@v2
id: restore-build
with:
path: ./*
key: ${{ github.sha }}
- name: build
run: npm run build:all

- name: run tests
run: node --max-old-space-size=8192 ./tools/jil/bin/cli.js -f merged -b chrome@* -s -t 85000 --concurrent=10 --functional-only
chrome-unit:
if: contains(fromJson('["workflow_dispatch"]'), github.event_name) || contains(github.event.pull_request.labels.*.name, 'safe to test')
timeout-minutes: 30
continue-on-error: true
runs-on: ubuntu-latest
container: node:14
needs: [cache-build]

env:
NEWRELIC_ENVIRONMENT: ci
JIL_SAUCE_LABS_USERNAME: ${{ secrets.JIL_SAUCE_LABS_USERNAME }}
Expand All @@ -117,20 +91,18 @@ jobs:
- name: install
run: npm ci --cache ./.npm

- uses: actions/cache@v2
id: restore-build
with:
path: ./*
key: ${{ github.sha }}
- name: build
run: npm run build:all

- name: run tests
run: node --max-old-space-size=8192 ./tools/jil/bin/cli.js -f merged -b chrome@* -s -t 85000 --concurrent=10 --unit-only
firefox-functional:
if: contains(fromJson('["workflow_dispatch"]'), github.event_name) || contains(github.event.pull_request.labels.*.name, 'safe to test')
timeout-minutes: 30
continue-on-error: true
runs-on: ubuntu-latest
container: node:14
needs: [cache-build]

env:
NEWRELIC_ENVIRONMENT: ci
JIL_SAUCE_LABS_USERNAME: ${{ secrets.JIL_SAUCE_LABS_USERNAME }}
Expand All @@ -145,20 +117,18 @@ jobs:
- name: install
run: npm ci --cache ./.npm

- uses: actions/cache@v2
id: restore-build
with:
path: ./*
key: ${{ github.sha }}
- name: build
run: npm run build:all

- name: run tests
run: node --max-old-space-size=8192 ./tools/jil/bin/cli.js -f merged -b firefox@* -s -t 85000 --concurrent=10 --functional-only
firefox-unit:
if: contains(fromJson('["workflow_dispatch"]'), github.event_name) || contains(github.event.pull_request.labels.*.name, 'safe to test')
timeout-minutes: 30
continue-on-error: true
runs-on: ubuntu-latest
container: node:14
needs: [cache-build]

env:
NEWRELIC_ENVIRONMENT: ci
JIL_SAUCE_LABS_USERNAME: ${{ secrets.JIL_SAUCE_LABS_USERNAME }}
Expand All @@ -173,20 +143,18 @@ jobs:
- name: install
run: npm ci --cache ./.npm

- uses: actions/cache@v2
id: restore-build
with:
path: ./*
key: ${{ github.sha }}
- name: build
run: npm run build:all

- name: run tests
run: node --max-old-space-size=8192 ./tools/jil/bin/cli.js -f merged -b firefox@* -s -t 85000 --concurrent=10 --unit-only
edge-functional:
if: contains(fromJson('["workflow_dispatch"]'), github.event_name) || contains(github.event.pull_request.labels.*.name, 'safe to test')
timeout-minutes: 30
continue-on-error: true
runs-on: ubuntu-latest
container: node:14
needs: [cache-build]

env:
NEWRELIC_ENVIRONMENT: ci
JIL_SAUCE_LABS_USERNAME: ${{ secrets.JIL_SAUCE_LABS_USERNAME }}
Expand All @@ -201,20 +169,18 @@ jobs:
- name: install
run: npm ci --cache ./.npm

- uses: actions/cache@v2
id: restore-build
with:
path: ./*
key: ${{ github.sha }}
- name: build
run: npm run build:all

- name: run tests
run: node --max-old-space-size=8192 ./tools/jil/bin/cli.js -f merged -b edge@* -s -t 85000 --concurrent=10 --functional-only
edge-unit:
if: contains(fromJson('["workflow_dispatch"]'), github.event_name) || contains(github.event.pull_request.labels.*.name, 'safe to test')
timeout-minutes: 30
continue-on-error: true
runs-on: ubuntu-latest
container: node:14
needs: [cache-build]

env:
NEWRELIC_ENVIRONMENT: ci
JIL_SAUCE_LABS_USERNAME: ${{ secrets.JIL_SAUCE_LABS_USERNAME }}
Expand All @@ -229,20 +195,18 @@ jobs:
- name: install
run: npm ci --cache ./.npm

- uses: actions/cache@v2
id: restore-build
with:
path: ./*
key: ${{ github.sha }}
- name: build
run: npm run build:all

- name: run tests
run: node --max-old-space-size=8192 ./tools/jil/bin/cli.js -f merged -b edge@* -s -t 85000 --concurrent=10 --unit-only
safari-functional:
if: contains(fromJson('["workflow_dispatch"]'), github.event_name) || contains(github.event.pull_request.labels.*.name, 'safe to test')
timeout-minutes: 30
continue-on-error: true
runs-on: ubuntu-latest
container: node:14
needs: [cache-build]

env:
NEWRELIC_ENVIRONMENT: ci
JIL_SAUCE_LABS_USERNAME: ${{ secrets.JIL_SAUCE_LABS_USERNAME }}
Expand All @@ -257,20 +221,18 @@ jobs:
- name: install
run: npm ci --cache ./.npm

- uses: actions/cache@v2
id: restore-build
with:
path: ./*
key: ${{ github.sha }}
- name: build
run: npm run build:all

- name: run tests
run: node --max-old-space-size=8192 ./tools/jil/bin/cli.js -f merged -b safari@* -s -t 85000 --concurrent=10 --functional-only
safari-unit:
if: contains(fromJson('["workflow_dispatch"]'), github.event_name) || contains(github.event.pull_request.labels.*.name, 'safe to test')
timeout-minutes: 30
continue-on-error: true
runs-on: ubuntu-latest
container: node:14
needs: [cache-build]

env:
NEWRELIC_ENVIRONMENT: ci
JIL_SAUCE_LABS_USERNAME: ${{ secrets.JIL_SAUCE_LABS_USERNAME }}
Expand All @@ -285,20 +247,18 @@ jobs:
- name: install
run: npm ci --cache ./.npm

- uses: actions/cache@v2
id: restore-build
with:
path: ./*
key: ${{ github.sha }}
- name: build
run: npm run build:all

- name: run tests
run: node --max-old-space-size=8192 ./tools/jil/bin/cli.js -f merged -b safari@* -s -t 85000 --concurrent=10 --unit-only
ios-functional:
if: contains(fromJson('["workflow_dispatch"]'), github.event_name) || contains(github.event.pull_request.labels.*.name, 'safe to test')
timeout-minutes: 30
continue-on-error: true
runs-on: ubuntu-latest
container: node:14
needs: [cache-build]

env:
NEWRELIC_ENVIRONMENT: ci
JIL_SAUCE_LABS_USERNAME: ${{ secrets.JIL_SAUCE_LABS_USERNAME }}
Expand All @@ -313,20 +273,18 @@ jobs:
- name: install
run: npm ci --cache ./.npm

- uses: actions/cache@v2
id: restore-build
with:
path: ./*
key: ${{ github.sha }}
- name: build
run: npm run build:all

- name: run tests
run: node --max-old-space-size=8192 ./tools/jil/bin/cli.js -f merged -b ios@* -s -t 85000 --concurrent=10 --functional-only
ios-unit:
if: contains(fromJson('["workflow_dispatch"]'), github.event_name) || contains(github.event.pull_request.labels.*.name, 'safe to test')
timeout-minutes: 30
continue-on-error: true
runs-on: ubuntu-latest
container: node:14
needs: [cache-build]

env:
NEWRELIC_ENVIRONMENT: ci
JIL_SAUCE_LABS_USERNAME: ${{ secrets.JIL_SAUCE_LABS_USERNAME }}
Expand All @@ -341,20 +299,18 @@ jobs:
- name: install
run: npm ci --cache ./.npm

- uses: actions/cache@v2
id: restore-build
with:
path: ./*
key: ${{ github.sha }}
- name: build
run: npm run build:all

- name: run tests
run: node --max-old-space-size=8192 ./tools/jil/bin/cli.js -f merged -b ios@* -s -t 85000 --concurrent=10 --unit-only
# android-functional:
# if: contains(fromJson('["workflow_dispatch"]'), github.event_name) || contains(github.event.pull_request.labels.*.name, 'safe to test')
# timeout-minutes: 30
# continue-on-error: true
# runs-on: ubuntu-latest
# container: node:14
# needs: [cache-build]
#
# env:
# NEWRELIC_ENVIRONMENT: ci
# JIL_SAUCE_LABS_USERNAME: ${{ secrets.JIL_SAUCE_LABS_USERNAME }}
Expand All @@ -369,20 +325,19 @@ jobs:
# - name: install
# run: npm ci --cache ./.npm

# - uses: actions/cache@v2
# id: restore-build
# with:
# path: ./*
# key: ${{ github.sha }}
#
# - name: build
# run: npm run build:all

# - name: run tests
# run: node --max-old-space-size=8192 ./tools/jil/bin/cli.js -f merged -b android@* -s -t 85000 --concurrent=10 --functional-only
# android-unit:
# if: contains(fromJson('["workflow_dispatch"]'), github.event_name) || contains(github.event.pull_request.labels.*.name, 'safe to test')
# timeout-minutes: 30
# continue-on-error: true
# runs-on: ubuntu-latest
# container: node:14
# needs: [cache-build]
#
# env:
# NEWRELIC_ENVIRONMENT: ci
# JIL_SAUCE_LABS_USERNAME: ${{ secrets.JIL_SAUCE_LABS_USERNAME }}
Expand All @@ -397,11 +352,9 @@ jobs:
# - name: install
# run: npm ci --cache ./.npm

# - uses: actions/cache@v2
# id: restore-build
# with:
# path: ./*
# key: ${{ github.sha }}
#
# - name: build
# run: npm run build:all

# - name: run tests
# run: node --max-old-space-size=8192 ./tools/jil/bin/cli.js -f merged -b android@* -s -t 85000 --concurrent=10 --unit-only
Expand Down
5 changes: 0 additions & 5 deletions cdn/agent-loader/lite.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@
* Copyright 2020 New Relic Corporation. All rights reserved.
* SPDX-License-Identifier: Apache-2.0
*/
// polyfills
import 'core-js/actual/promise'
import 'core-js/actual/array/includes'
import 'core-js/actual/object/assign'
import 'core-js/actual/object/entries'
// cdn specific utility files
import agentIdentifier from '../shared/agentIdentifier'
import { stageAggregator } from './utils/importAggregator'
Expand Down
Loading

0 comments on commit 45bebf2

Please sign in to comment.