Unverified Commit 3cece4d2 authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Update Azure config (#18931)

parent 9e59a6b5
...@@ -15,3 +15,4 @@ packages/next-codemod/**/*.js ...@@ -15,3 +15,4 @@ packages/next-codemod/**/*.js
packages/next-codemod/**/*.d.ts packages/next-codemod/**/*.d.ts
packages/next-env/**/*.d.ts packages/next-env/**/*.d.ts
test/integration/async-modules/** test/integration/async-modules/**
test-timings.json
\ No newline at end of file
...@@ -15,6 +15,7 @@ jobs: ...@@ -15,6 +15,7 @@ jobs:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/*
- run: yarn install --frozen-lockfile --check-files - run: yarn install --frozen-lockfile --check-files
- run: node run-tests.js --timings --write-timings -g 1/4
- uses: actions/cache@v2 - uses: actions/cache@v2
id: cache-build id: cache-build
with: with:
......
...@@ -31,6 +31,7 @@ examples/**/out ...@@ -31,6 +31,7 @@ examples/**/out
examples/**/.env*.local examples/**/.env*.local
pr-stats.md pr-stats.md
test-timings.json
# Vercel # Vercel
.vercel .vercel
......
...@@ -13,4 +13,5 @@ packages/next-codemod/transforms/__testfixtures__/**/* ...@@ -13,4 +13,5 @@ packages/next-codemod/transforms/__testfixtures__/**/*
packages/next-codemod/transforms/__tests__/**/* packages/next-codemod/transforms/__tests__/**/*
packages/next-codemod/**/*.js packages/next-codemod/**/*.js
packages/next-codemod/**/*.d.ts packages/next-codemod/**/*.d.ts
packages/next-env/**/*.d.ts packages/next-env/**/*.d.ts
\ No newline at end of file test-timings.json
\ No newline at end of file
...@@ -3,64 +3,95 @@ variables: ...@@ -3,64 +3,95 @@ variables:
NEXT_TELEMETRY_DISABLED: '1' NEXT_TELEMETRY_DISABLED: '1'
node_version: ^10.10.0 node_version: ^10.10.0
jobs: stages:
- job: test_ie11 - stage: Build
pool: jobs:
vmImage: 'windows-2019' - job: build
steps: pool:
- task: NodeTool@0 vmImage: 'windows-2019'
inputs: steps:
versionSpec: $(node_version) - script: echo $(Agent.BuildDirectory)
displayName: 'Install Node.js' - script: dir
- script: dir $(System.DefaultWorkingDirectory)
- task: CacheBeta@0 - script: echo $(System.pullRequest.sourceCommitId)
inputs: - powershell: Set-MpPreference -ExclusionPath $(System.DefaultWorkingDirectory)
key: yarn | $(Agent.OS) | yarn.lock - powershell: Set-MpPreference -ExclusionPath $(Pipeline.Workspace)/.yarn
path: $(YARN_CACHE_FOLDER) - powershell: Set-MpPreference -DisableIntrusionPreventionSystem $true -DisableIOAVProtection $true -DisableRealtimeMonitoring $true -DisableScriptScanning $true -EnableControlledFolderAccess Disabled -EnableNetworkProtection AuditMode -Force -MAPSReporting Disabled -SubmitSamplesConsent NeverSend
displayName: Cache Yarn packages - powershell: Get-MpComputerStatus
- task: NodeTool@0
- script: | inputs:
yarn install --frozen-lockfile --check-files versionSpec: $(node_version)
displayName: 'Install dependencies' displayName: 'Install Node.js'
- task: Cache@2
- script: | inputs:
yarn testie --forceExit test/integration/production/ # use deterministic cache key that is specific
displayName: 'Run tests' # to this test run
key: $(System.pullRequest.sourceCommitId)
- job: test_chrome path: $(System.DefaultWorkingDirectory)
pool: displayName: Cache Build
vmImage: 'windows-2019' - script: |
strategy: yarn install --frozen-lockfile --check-files
maxParallel: 10 displayName: 'Install dependencies'
matrix: - script: |
node-10-1: node run-tests.js --timings --write-timings --azure -g 1/4
group: 1/4 displayName: 'Fetch test timing data'
node-10-2: - stage: Test
group: 2/4 dependsOn: Build
node-10-3: jobs:
group: 3/4 - job: test_ie11
node-10-4: pool:
group: 4/4 vmImage: 'windows-2019'
steps: steps:
- script: | - checkout: none
wmic datafile where name="C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe" get Version /value - powershell: Set-MpPreference -ExclusionPath $(System.DefaultWorkingDirectory)
displayName: 'List Chrome version' - powershell: Set-MpPreference -ExclusionPath $(Pipeline.Workspace)/.yarn
- powershell: Set-MpPreference -DisableIntrusionPreventionSystem $true -DisableIOAVProtection $true -DisableRealtimeMonitoring $true -DisableScriptScanning $true -EnableControlledFolderAccess Disabled -EnableNetworkProtection AuditMode -Force -MAPSReporting Disabled -SubmitSamplesConsent NeverSend
- task: NodeTool@0 - task: NodeTool@0
inputs: inputs:
versionSpec: $(node_version) versionSpec: $(node_version)
displayName: 'Install Node.js' displayName: 'Install Node.js'
- task: Cache@2
- task: CacheBeta@0 inputs:
inputs: # use deterministic cache key that is specific
key: yarn | $(Agent.OS) | yarn.lock # to this test run
path: $(YARN_CACHE_FOLDER) key: $(System.pullRequest.sourceCommitId)
displayName: Cache Yarn packages path: $(System.DefaultWorkingDirectory)
displayName: Cache Build
- script: | - script: |
yarn install --frozen-lockfile --check-files yarn testie --forceExit test/integration/production/
displayName: 'Install dependencies' displayName: 'Run tests'
- job: test_chrome
- script: | pool:
node run-tests.js -g $(group) --timings --azure vmImage: 'windows-2019'
displayName: 'Run tests' strategy:
matrix:
node-10-1:
group: 1/4
node-10-2:
group: 2/4
node-10-3:
group: 3/4
node-10-4:
group: 4/4
steps:
- checkout: none
- powershell: Set-MpPreference -ExclusionPath $(System.DefaultWorkingDirectory)
- powershell: Set-MpPreference -ExclusionPath $(Pipeline.Workspace)/.yarn
- powershell: Set-MpPreference -DisableIntrusionPreventionSystem $true -DisableIOAVProtection $true -DisableRealtimeMonitoring $true -DisableScriptScanning $true -EnableControlledFolderAccess Disabled -EnableNetworkProtection AuditMode -Force -MAPSReporting Disabled -SubmitSamplesConsent NeverSend
- script: |
wmic datafile where name="C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe" get Version /value
displayName: 'List Chrome version'
- task: NodeTool@0
inputs:
versionSpec: $(node_version)
displayName: 'Install Node.js'
- task: Cache@2
inputs:
# use deterministic cache key that is specific
# to this test run
key: $(System.pullRequest.sourceCommitId)
path: $(System.DefaultWorkingDirectory)
displayName: Cache Build
- script: |
node run-tests.js -g $(group) --timings --azure
displayName: 'Run tests'
...@@ -22,6 +22,7 @@ const TIMINGS_API = `https://next-timings.jjsweb.site/api/timings` ...@@ -22,6 +22,7 @@ const TIMINGS_API = `https://next-timings.jjsweb.site/api/timings`
parseInt(process.argv[concurrencyIdx + 1], 10) || DEFAULT_CONCURRENCY parseInt(process.argv[concurrencyIdx + 1], 10) || DEFAULT_CONCURRENCY
const outputTimings = process.argv.indexOf('--timings') !== -1 const outputTimings = process.argv.indexOf('--timings') !== -1
const writeTimings = process.argv.indexOf('--write-timings') !== -1
const isAzure = process.argv.indexOf('--azure') !== -1 const isAzure = process.argv.indexOf('--azure') !== -1
const groupIdx = process.argv.indexOf('-g') const groupIdx = process.argv.indexOf('-g')
const groupArg = groupIdx !== -1 && process.argv[groupIdx + 1] const groupArg = groupIdx !== -1 && process.argv[groupIdx + 1]
...@@ -39,15 +40,29 @@ const TIMINGS_API = `https://next-timings.jjsweb.site/api/timings` ...@@ -39,15 +40,29 @@ const TIMINGS_API = `https://next-timings.jjsweb.site/api/timings`
if (outputTimings && groupArg) { if (outputTimings && groupArg) {
console.log('Fetching previous timings data') console.log('Fetching previous timings data')
try { try {
const timingsRes = await fetch( const timingsFile = path.join(__dirname, 'test-timings.json')
`${TIMINGS_API}?which=${isAzure ? 'azure' : 'actions'}` try {
) prevTimings = JSON.parse(await fs.readFile(timingsFile, 'utf8'))
console.log('Loaded test timings from disk successfully')
} catch (_) {}
if (!timingsRes.ok) { if (!prevTimings) {
throw new Error(`request status: ${timingsRes.status}`) const timingsRes = await fetch(
`${TIMINGS_API}?which=${isAzure ? 'azure' : 'actions'}`
)
if (!timingsRes.ok) {
throw new Error(`request status: ${timingsRes.status}`)
}
prevTimings = await timingsRes.json()
console.log('Fetched previous timings data successfully')
if (writeTimings) {
await fs.writeFile(timingsFile, JSON.stringify(prevTimings))
console.log('Wrote previous timings data to', timingsFile)
process.exit(0)
}
} }
prevTimings = await timingsRes.json()
console.log('Fetched previous timings data successfully')
} catch (err) { } catch (err) {
console.log(`Failed to fetch timings data`, err) console.log(`Failed to fetch timings data`, err)
} }
......
...@@ -91,37 +91,37 @@ describe('Build Output', () => { ...@@ -91,37 +91,37 @@ describe('Build Output', () => {
} }
// should be no bigger than 265 bytes // should be no bigger than 265 bytes
expect(parseFloat(indexSize) - 265).toBeLessThanOrEqual(0) expect(parseFloat(indexSize) - 266).toBeLessThanOrEqual(0)
expect(indexSize.endsWith('B')).toBe(true) expect(indexSize.endsWith('B')).toBe(true)
// should be no bigger than 60.8 kb // should be no bigger than 60.8 kb
expect(parseFloat(indexFirstLoad) - 61.3).toBeLessThanOrEqual(0) expect(parseFloat(indexFirstLoad) - 61.4).toBeLessThanOrEqual(0)
expect(indexFirstLoad.endsWith('kB')).toBe(true) expect(indexFirstLoad.endsWith('kB')).toBe(true)
expect(parseFloat(err404Size) - 3.5).toBeLessThanOrEqual(0) expect(parseFloat(err404Size) - 3.6).toBeLessThanOrEqual(0)
expect(err404Size.endsWith('kB')).toBe(true) expect(err404Size.endsWith('kB')).toBe(true)
expect(parseFloat(err404FirstLoad) - 64.5).toBeLessThanOrEqual(0) expect(parseFloat(err404FirstLoad) - 64.6).toBeLessThanOrEqual(0)
expect(err404FirstLoad.endsWith('kB')).toBe(true) expect(err404FirstLoad.endsWith('kB')).toBe(true)
expect(parseFloat(sharedByAll) - 61.1).toBeLessThanOrEqual(0) expect(parseFloat(sharedByAll) - 61.2).toBeLessThanOrEqual(0)
expect(sharedByAll.endsWith('kB')).toBe(true) expect(sharedByAll.endsWith('kB')).toBe(true)
if (_appSize.endsWith('kB')) { if (_appSize.endsWith('kB')) {
expect(parseFloat(_appSize)).toBeLessThanOrEqual(1.01) expect(parseFloat(_appSize)).toBeLessThanOrEqual(1.02)
expect(_appSize.endsWith('kB')).toBe(true) expect(_appSize.endsWith('kB')).toBe(true)
} else { } else {
expect(parseFloat(_appSize) - 1000).toBeLessThanOrEqual(0) expect(parseFloat(_appSize) - 1000).toBeLessThanOrEqual(0)
expect(_appSize.endsWith(' B')).toBe(true) expect(_appSize.endsWith(' B')).toBe(true)
} }
expect(parseFloat(webpackSize) - 752).toBeLessThanOrEqual(0) expect(parseFloat(webpackSize) - 753).toBeLessThanOrEqual(0)
expect(webpackSize.endsWith(' B')).toBe(true) expect(webpackSize.endsWith(' B')).toBe(true)
expect(parseFloat(mainSize) - 7.44).toBeLessThanOrEqual(0) expect(parseFloat(mainSize) - 7.45).toBeLessThanOrEqual(0)
expect(mainSize.endsWith('kB')).toBe(true) expect(mainSize.endsWith('kB')).toBe(true)
expect(parseFloat(frameworkSize) - 41).toBeLessThanOrEqual(0) expect(parseFloat(frameworkSize) - 42).toBeLessThanOrEqual(0)
expect(frameworkSize.endsWith('kB')).toBe(true) expect(frameworkSize.endsWith('kB')).toBe(true)
}) })
......
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