From c4e42f1eb720ea7dd80edb1cb1a698b1be195ac3 Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Tue, 2 Jul 2019 18:25:29 -0700 Subject: [PATCH 1/9] Ignore certain steps and parallelize webpack --- gulpfile.js | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 77bcb96cece7..a5703d8d6aa5 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -115,9 +115,19 @@ gulp.task('compile-webviews', async () => ); gulp.task('webpack', async () => { + // Build dependencies. await buildWebPack('production', []); - await buildWebPack('extension', ['--config', './build/webpack/webpack.extension.config.js']); - await buildWebPack('debugAdapter', ['--config', './build/webpack/webpack.debugadapter.config.js']); + // Run both in parallel, for faster process on CI. + // Yes, console would print output from both, that's ok, we have a faster CI. + // If things fail, we can run locally separately. + if (isCI) { + const buildExtension = buildWebPack('extension', ['--config', './build/webpack/webpack.extension.config.js']); + const buildDebugAdapter = buildWebPack('debugAdapter', ['--config', './build/webpack/webpack.debugadapter.config.js']); + await Promise.all([buildExtension, buildDebugAdapter]); + } else { + await buildWebPack('extension', ['--config', './build/webpack/webpack.extension.config.js']); + await buildWebPack('debugAdapter', ['--config', './build/webpack/webpack.debugadapter.config.js']); + } }); gulp.task('updateBuildNumber', async () => { @@ -218,7 +228,7 @@ gulp.task('verifyBundle', async () => { } }); -gulp.task('prePublishBundle', gulp.series('checkNativeDependencies', 'check-datascience-dependencies', 'compile', 'clean:cleanExceptTests', 'webpack', 'renameSourceMaps')); +gulp.task('prePublishBundle', gulp.series('webpack', 'renameSourceMaps')); gulp.task('prePublishNonBundle', gulp.series('checkNativeDependencies', 'check-datascience-dependencies', 'compile', 'compile-webviews')); gulp.task('installPythonLibs', async () => { From a9a7fb50dd820b3150aa8434e9536a7a8675543e Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Tue, 2 Jul 2019 18:25:41 -0700 Subject: [PATCH 2/9] Cache node_modules --- build/ci/templates/uitest_phases.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/build/ci/templates/uitest_phases.yml b/build/ci/templates/uitest_phases.yml index 6099c94da19a..f5b839306f13 100644 --- a/build/ci/templates/uitest_phases.yml +++ b/build/ci/templates/uitest_phases.yml @@ -107,12 +107,26 @@ steps: verbose: true customCommand: "install -g npm@$(NpmVersion)" + - task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1 + inputs: + keyfile: 'package-lock.json' + targetfolder: 'node_modules' + vstsFeed: '$(ArtifactFeed)' + platformIndependent: true + - task: Npm@1 displayName: "npm ci" inputs: command: custom verbose: true customCommand: ci + condition: ne(variables['CacheRestored'], 'true') + + - task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1 + inputs: + keyfile: 'package-lock.json' + targetfolder: 'node_modules' + vstsFeed: '$(ArtifactFeed)' - bash: | echo AVAILABLE DEPENDENCY VERSIONS From 75ed7eb4d74a6ce20d47484548a2291ffe25ff1a Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Tue, 2 Jul 2019 18:27:29 -0700 Subject: [PATCH 3/9] Use existig npm --- build/ci/templates/uitest_phases.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/build/ci/templates/uitest_phases.yml b/build/ci/templates/uitest_phases.yml index f5b839306f13..013f01c298cd 100644 --- a/build/ci/templates/uitest_phases.yml +++ b/build/ci/templates/uitest_phases.yml @@ -100,12 +100,12 @@ steps: inputs: versionSpec: 3.7 - - task: Npm@1 - displayName: "Use NPM $(NpmVersion)" - inputs: - command: custom - verbose: true - customCommand: "install -g npm@$(NpmVersion)" + # - task: Npm@1 + # displayName: "Use NPM $(NpmVersion)" + # inputs: + # command: custom + # verbose: true + # customCommand: "install -g npm@$(NpmVersion)" - task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1 inputs: From d58ce49f4e36a2d09e5ff35a58b07599ae9a656b Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Tue, 2 Jul 2019 18:34:02 -0700 Subject: [PATCH 4/9] Disable untill extension is enabled in org --- build/ci/templates/uitest_phases.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/build/ci/templates/uitest_phases.yml b/build/ci/templates/uitest_phases.yml index 013f01c298cd..b6669415a2dd 100644 --- a/build/ci/templates/uitest_phases.yml +++ b/build/ci/templates/uitest_phases.yml @@ -107,12 +107,12 @@ steps: # verbose: true # customCommand: "install -g npm@$(NpmVersion)" - - task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1 - inputs: - keyfile: 'package-lock.json' - targetfolder: 'node_modules' - vstsFeed: '$(ArtifactFeed)' - platformIndependent: true + # - task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1 + # inputs: + # keyfile: 'package-lock.json' + # targetfolder: 'node_modules' + # vstsFeed: '$(ArtifactFeed)' + # platformIndependent: true - task: Npm@1 displayName: "npm ci" @@ -120,13 +120,13 @@ steps: command: custom verbose: true customCommand: ci - condition: ne(variables['CacheRestored'], 'true') + # condition: ne(variables['CacheRestored'], 'true') - - task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1 - inputs: - keyfile: 'package-lock.json' - targetfolder: 'node_modules' - vstsFeed: '$(ArtifactFeed)' + # - task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1 + # inputs: + # keyfile: 'package-lock.json' + # targetfolder: 'node_modules' + # vstsFeed: '$(ArtifactFeed)' - bash: | echo AVAILABLE DEPENDENCY VERSIONS From 9aca71c612938fd9705f79d21f238e5837832dae Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Tue, 2 Jul 2019 18:43:59 -0700 Subject: [PATCH 5/9] Revert unnecessary changes --- build/ci/templates/uitest_phases.yml | 26 ++++++-------------------- 1 file changed, 6 insertions(+), 20 deletions(-) diff --git a/build/ci/templates/uitest_phases.yml b/build/ci/templates/uitest_phases.yml index b6669415a2dd..6099c94da19a 100644 --- a/build/ci/templates/uitest_phases.yml +++ b/build/ci/templates/uitest_phases.yml @@ -100,19 +100,12 @@ steps: inputs: versionSpec: 3.7 - # - task: Npm@1 - # displayName: "Use NPM $(NpmVersion)" - # inputs: - # command: custom - # verbose: true - # customCommand: "install -g npm@$(NpmVersion)" - - # - task: 1ESLighthouseEng.PipelineArtifactCaching.RestoreCacheV1.RestoreCache@1 - # inputs: - # keyfile: 'package-lock.json' - # targetfolder: 'node_modules' - # vstsFeed: '$(ArtifactFeed)' - # platformIndependent: true + - task: Npm@1 + displayName: "Use NPM $(NpmVersion)" + inputs: + command: custom + verbose: true + customCommand: "install -g npm@$(NpmVersion)" - task: Npm@1 displayName: "npm ci" @@ -120,13 +113,6 @@ steps: command: custom verbose: true customCommand: ci - # condition: ne(variables['CacheRestored'], 'true') - - # - task: 1ESLighthouseEng.PipelineArtifactCaching.SaveCacheV1.SaveCache@1 - # inputs: - # keyfile: 'package-lock.json' - # targetfolder: 'node_modules' - # vstsFeed: '$(ArtifactFeed)' - bash: | echo AVAILABLE DEPENDENCY VERSIONS From 4500126933f6b2ece5d0652012d922b990ac6aac Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Tue, 2 Jul 2019 18:45:57 -0700 Subject: [PATCH 6/9] Test --- build/ci/vscode-python-pr-validation.yaml | 30 +++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/build/ci/vscode-python-pr-validation.yaml b/build/ci/vscode-python-pr-validation.yaml index 25f3a14dad89..0cecd7968162 100644 --- a/build/ci/vscode-python-pr-validation.yaml +++ b/build/ci/vscode-python-pr-validation.yaml @@ -30,9 +30,39 @@ jobs: # In PRs, test only against stable version of VSC. vscodeChannels: ['stable'] # In PRs, run smoke tests against 3.7 and 2.7 (excluding others). + jobs: + - test: "Smokex" + tags: "--tags=@smoke" + ignorePythonVersions: "3.6,3.5" + +- template: templates/uitest_jobs.yml + parameters: jobs: - test: "Smoke" tags: "--tags=@smoke" + # Smoke tests are cheap, so run them against all Python Versions. + - test: "Test" + tags: "--tags=@testing" + # We have python code that is involved in running/discovering tests. + # Hence test against all versions, until we have CI running for the Python code. + # I.e. when all test dicovery/running is done purely in Python. + - test: "Terminal" + tags: "--tags=@terminal --tags=~@terminal.pipenv" + # No need to run tests against all versions. + # This is faster/cheaper, besides activation of terminals is generic enough + # not to warrant testing against all versions. + ignorePythonVersions: "3.6,3.5" + - test: "Debugging" + tags: "--tags=@debugging" + # No need to run tests against all versions. + # This is faster/cheaper, and these are external packages. + # We expect them to work (or 3rd party packages to test against all PY versions). + ignorePythonVersions: "3.6,3.5" + - test: "Jedi_Language_Server" + tags: "--tags=@ls" + # No need to run tests against all versions. + # This is faster/cheaper, and these are external packages. + # We expect them to work (or 3rd party packages to test against all PY versions). ignorePythonVersions: "3.6,3.5" - job: 'PR' From ab720f54ee799e6caece40795a379becb642ac8d Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Tue, 2 Jul 2019 18:47:56 -0700 Subject: [PATCH 7/9] Fixes --- build/ci/vscode-python-pr-validation.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/build/ci/vscode-python-pr-validation.yaml b/build/ci/vscode-python-pr-validation.yaml index 0cecd7968162..02121149cc15 100644 --- a/build/ci/vscode-python-pr-validation.yaml +++ b/build/ci/vscode-python-pr-validation.yaml @@ -25,15 +25,15 @@ variables: jobs: - template: templates/build_compile_jobs.yml -- template: templates/uitest_jobs.yml - parameters: - # In PRs, test only against stable version of VSC. - vscodeChannels: ['stable'] - # In PRs, run smoke tests against 3.7 and 2.7 (excluding others). - jobs: - - test: "Smokex" - tags: "--tags=@smoke" - ignorePythonVersions: "3.6,3.5" +# - template: templates/uitest_jobs.yml +# parameters: +# # In PRs, test only against stable version of VSC. +# vscodeChannels: ['stable'] +# # In PRs, run smoke tests against 3.7 and 2.7 (excluding others). +# jobs: +# - test: "Smoke" +# tags: "--tags=@smoke" +# ignorePythonVersions: "3.6,3.5" - template: templates/uitest_jobs.yml parameters: From 574befdf57f914d286d86a58c66ba988a70dfa10 Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Tue, 2 Jul 2019 19:39:36 -0700 Subject: [PATCH 8/9] Comments --- gulpfile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gulpfile.js b/gulpfile.js index a5703d8d6aa5..7c6b1d7fc18a 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -115,7 +115,7 @@ gulp.task('compile-webviews', async () => ); gulp.task('webpack', async () => { - // Build dependencies. + // Build node_modules and DS stuff. await buildWebPack('production', []); // Run both in parallel, for faster process on CI. // Yes, console would print output from both, that's ok, we have a faster CI. From f7840f9f63f2a6d30bbad61b2451f023d0992ecb Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Tue, 2 Jul 2019 19:42:06 -0700 Subject: [PATCH 9/9] Revert unnecessary changes --- build/ci/vscode-python-pr-validation.yaml | 36 ++--------------------- 1 file changed, 3 insertions(+), 33 deletions(-) diff --git a/build/ci/vscode-python-pr-validation.yaml b/build/ci/vscode-python-pr-validation.yaml index 02121149cc15..25f3a14dad89 100644 --- a/build/ci/vscode-python-pr-validation.yaml +++ b/build/ci/vscode-python-pr-validation.yaml @@ -25,44 +25,14 @@ variables: jobs: - template: templates/build_compile_jobs.yml -# - template: templates/uitest_jobs.yml -# parameters: -# # In PRs, test only against stable version of VSC. -# vscodeChannels: ['stable'] -# # In PRs, run smoke tests against 3.7 and 2.7 (excluding others). -# jobs: -# - test: "Smoke" -# tags: "--tags=@smoke" -# ignorePythonVersions: "3.6,3.5" - - template: templates/uitest_jobs.yml parameters: + # In PRs, test only against stable version of VSC. + vscodeChannels: ['stable'] + # In PRs, run smoke tests against 3.7 and 2.7 (excluding others). jobs: - test: "Smoke" tags: "--tags=@smoke" - # Smoke tests are cheap, so run them against all Python Versions. - - test: "Test" - tags: "--tags=@testing" - # We have python code that is involved in running/discovering tests. - # Hence test against all versions, until we have CI running for the Python code. - # I.e. when all test dicovery/running is done purely in Python. - - test: "Terminal" - tags: "--tags=@terminal --tags=~@terminal.pipenv" - # No need to run tests against all versions. - # This is faster/cheaper, besides activation of terminals is generic enough - # not to warrant testing against all versions. - ignorePythonVersions: "3.6,3.5" - - test: "Debugging" - tags: "--tags=@debugging" - # No need to run tests against all versions. - # This is faster/cheaper, and these are external packages. - # We expect them to work (or 3rd party packages to test against all PY versions). - ignorePythonVersions: "3.6,3.5" - - test: "Jedi_Language_Server" - tags: "--tags=@ls" - # No need to run tests against all versions. - # This is faster/cheaper, and these are external packages. - # We expect them to work (or 3rd party packages to test against all PY versions). ignorePythonVersions: "3.6,3.5" - job: 'PR'