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
......
...@@ -14,3 +14,4 @@ packages/next-codemod/transforms/__tests__/**/* ...@@ -14,3 +14,4 @@ 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
test-timings.json
\ No newline at end of file
...@@ -3,35 +3,67 @@ variables: ...@@ -3,35 +3,67 @@ 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
jobs:
- job: build
pool: pool:
vmImage: 'windows-2019' vmImage: 'windows-2019'
steps: steps:
- script: echo $(Agent.BuildDirectory)
- script: dir
- script: dir $(System.DefaultWorkingDirectory)
- script: echo $(System.pullRequest.sourceCommitId)
- 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
- powershell: Get-MpComputerStatus
- 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:
key: yarn | $(Agent.OS) | yarn.lock # use deterministic cache key that is specific
path: $(YARN_CACHE_FOLDER) # to this test run
displayName: Cache Yarn packages key: $(System.pullRequest.sourceCommitId)
path: $(System.DefaultWorkingDirectory)
displayName: Cache Build
- script: | - script: |
yarn install --frozen-lockfile --check-files yarn install --frozen-lockfile --check-files
displayName: 'Install dependencies' displayName: 'Install dependencies'
- script: |
node run-tests.js --timings --write-timings --azure -g 1/4
displayName: 'Fetch test timing data'
- stage: Test
dependsOn: Build
jobs:
- job: test_ie11
pool:
vmImage: 'windows-2019'
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
- 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: | - script: |
yarn testie --forceExit test/integration/production/ yarn testie --forceExit test/integration/production/
displayName: 'Run tests' displayName: 'Run tests'
- job: test_chrome - job: test_chrome
pool: pool:
vmImage: 'windows-2019' vmImage: 'windows-2019'
strategy: strategy:
maxParallel: 10
matrix: matrix:
node-10-1: node-10-1:
group: 1/4 group: 1/4
...@@ -42,25 +74,24 @@ jobs: ...@@ -42,25 +74,24 @@ jobs:
node-10-4: node-10-4:
group: 4/4 group: 4/4
steps: 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: | - script: |
wmic datafile where name="C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe" get Version /value wmic datafile where name="C:\\Program Files (x86)\\Google\\Chrome\\Application\\chrome.exe" get Version /value
displayName: 'List Chrome version' displayName: 'List Chrome version'
- 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:
key: yarn | $(Agent.OS) | yarn.lock # use deterministic cache key that is specific
path: $(YARN_CACHE_FOLDER) # to this test run
displayName: Cache Yarn packages key: $(System.pullRequest.sourceCommitId)
path: $(System.DefaultWorkingDirectory)
- script: | displayName: Cache Build
yarn install --frozen-lockfile --check-files
displayName: 'Install dependencies'
- script: | - script: |
node run-tests.js -g $(group) --timings --azure node run-tests.js -g $(group) --timings --azure
displayName: 'Run tests' 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,6 +40,13 @@ const TIMINGS_API = `https://next-timings.jjsweb.site/api/timings` ...@@ -39,6 +40,13 @@ 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 timingsFile = path.join(__dirname, 'test-timings.json')
try {
prevTimings = JSON.parse(await fs.readFile(timingsFile, 'utf8'))
console.log('Loaded test timings from disk successfully')
} catch (_) {}
if (!prevTimings) {
const timingsRes = await fetch( const timingsRes = await fetch(
`${TIMINGS_API}?which=${isAzure ? 'azure' : 'actions'}` `${TIMINGS_API}?which=${isAzure ? 'azure' : 'actions'}`
) )
...@@ -48,6 +56,13 @@ const TIMINGS_API = `https://next-timings.jjsweb.site/api/timings` ...@@ -48,6 +56,13 @@ const TIMINGS_API = `https://next-timings.jjsweb.site/api/timings`
} }
prevTimings = await timingsRes.json() prevTimings = await timingsRes.json()
console.log('Fetched previous timings data successfully') 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)
}
}
} 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