-
Notifications
You must be signed in to change notification settings - Fork 562
Use internal repository to manage secondary pipeline dependencies #25535
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
4b4b1fa
First attempt at using setup repo
6c76dd1
fix syntax
1efc5ef
Install pnpm first
4801f7d
Specify buildDirectory
e5e5744
testWorkspace -> build.sourcesdirectory
545eaec
Specify working directory on npm scripts
8552d32
Use correct script names
afba3ba
Restore initialize step, remove unnecessary parts
f39d745
Run initialize from sources directory, also start adapting telemetry-…
6e8828b
Remove --no-frozen-lockfile
4bacb31
Try plumbing reservation id through env
3238fd7
Add inline install
8b12f72
Fix some path manipulation bugs
c316cb0
More path updates
b3766b4
Remove get-test-pass-rate script
e422588
Use pnpm exec over indirecting through scripts
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -136,7 +136,7 @@ stages: | |
| - name: FORCE_COLOR | ||
| value: 1 | ||
| - name: testPackageDir | ||
| value: '${{ parameters.testWorkspace }}/node_modules/${{ parameters.testPackage }}' | ||
| value: '$(Build.SourcesDirectory)/node_modules/${{ parameters.testPackage }}' | ||
| - name: testPackageFilePattern | ||
| value: ${{ replace(replace(parameters.testPackage, '@', '' ), '/', '-') }}-[0-9]*.tgz | ||
| # Note that this path must match the path that the packed packages are saved to in the build pipeline. | ||
|
|
@@ -150,7 +150,7 @@ stages: | |
|
|
||
| steps: | ||
| # Setup | ||
| - checkout: none | ||
| - checkout: git://internal/ff_pipeline_host | ||
| clean: true | ||
|
|
||
| # Install self-signed cert for R11s deployment in local cert store | ||
|
|
@@ -206,8 +206,20 @@ stages: | |
|
|
||
| - template: /tools/pipelines/templates/include-use-node-version.yml@self | ||
|
|
||
| - template: /tools/pipelines/templates/include-install-pnpm.yml@self | ||
| parameters: | ||
| buildDirectory: $(Build.SourcesDirectory) | ||
|
|
||
| - template: /tools/pipelines/templates/include-setup-npmrc-for-download.yml@self | ||
|
|
||
| - task: Bash@3 | ||
| displayName: Install base dependencies | ||
| inputs: | ||
| targetType: 'inline' | ||
| script: | | ||
| set -eu -o pipefail | ||
| pnpm install | ||
|
|
||
| # Download artifact | ||
| - task: DownloadPipelineArtifact@2 | ||
| displayName: Download test package | ||
|
|
@@ -228,46 +240,31 @@ stages: | |
| # - buildId: <the id of the triggering build> | ||
| # preferTriggeringPipeline: true | ||
|
|
||
| - task: Bash@3 | ||
| displayName: Create test directory | ||
| inputs: | ||
| targetType: 'inline' | ||
| script: | | ||
| set -eu -o pipefail | ||
|
|
||
| mkdir ${{ parameters.testWorkspace }} | ||
|
|
||
| - task: Bash@3 | ||
| name: Initialize | ||
| displayName: Initialize | ||
| inputs: | ||
| targetType: 'inline' | ||
| workingDirectory: ${{ parameters.testWorkspace }} | ||
| workingDirectory: $(Build.SourcesDirectory) | ||
| script: | | ||
| set -eu -o pipefail | ||
|
|
||
| echo Initialize package | ||
| npm init --yes | ||
|
|
||
| if [[ `ls -1 ${{ variables.testPackagePathPattern }} | wc -l` -eq 1 ]]; then | ||
| echo "##vso[task.setvariable variable=testPackageTgz;isOutput=true]`ls ${{ variables.testPackagePathPattern }}`" | ||
| else | ||
| ls -1 ${{ variables.testPackagePathPattern }} | ||
| echo "##vso[task.logissue type=error]Test package '${{ parameters.testPackage }}' not found, or there are more than one found" | ||
| exit -1 | ||
| fi | ||
|
|
||
| # Install test and logger packages | ||
| # Install test package | ||
| - task: Bash@3 | ||
| displayName: 'npm install' | ||
| displayName: 'pnpm install' | ||
| # ADO feeds have latency on the order of minutes before packages are available downstream. See: | ||
| # https://learn.microsoft.com/en-us/azure/devops/artifacts/concepts/upstream-sources?view=azure-devops#upstream-sources-health-status | ||
| # This pipeline installs packages which were published very recently relative to its runtime, hence the rather high retry count here. | ||
| retryCountOnTaskFailure: 10 | ||
| inputs: | ||
| workingDirectory: ${{ parameters.testWorkspace }} | ||
| targetType: 'inline' | ||
| script: 'npm install $(Initialize.testPackageTgz) ${{ parameters.loggerPackage }}' | ||
| script: 'pnpm install $(Initialize.testPackageTgz)' | ||
|
|
||
| # Download Test Files & Install Extra Dependencies | ||
| # These steps are intended to include extra dependencies that are not available as | ||
|
|
@@ -296,7 +293,7 @@ stages: | |
| - task: Bash@3 | ||
| displayName: Unpack test files | ||
| inputs: | ||
| workingDirectory: ${{ parameters.testWorkspace }}/node_modules/${{ parameters.testPackage }} | ||
| workingDirectory: $(Build.SourcesDirectory)/node_modules/${{ parameters.testPackage }} | ||
| targetType: 'inline' | ||
| script: | | ||
| set -eu -o pipefail | ||
|
|
@@ -315,13 +312,12 @@ stages: | |
| - task: Bash@3 | ||
| displayName: Copy devDependencies | ||
| inputs: | ||
| workingDirectory: ${{ parameters.testWorkspace }} | ||
| targetType: 'inline' | ||
| script: | | ||
| set -eu -o pipefail | ||
|
|
||
| testPkgJsonPath=${{ parameters.testWorkspace }}/node_modules/${{ parameters.testPackage }}/package.json | ||
| pkgJsonPath=${{ parameters.testWorkspace }}/package.json | ||
| testPkgJsonPath=$(Build.SourcesDirectory)/node_modules/${{ parameters.testPackage }}/package.json | ||
| pkgJsonPath=$(Build.SourcesDirectory)/package.json | ||
| node -e " | ||
| const { devDependencies } = require('$testPkgJsonPath'); | ||
| const pkg = require('$pkgJsonPath'); | ||
|
|
@@ -330,12 +326,11 @@ stages: | |
| " | ||
|
|
||
| - task: Bash@3 | ||
| displayName: 'npm install - extra dependencies for test files' | ||
| displayName: 'pnpm install - extra dependencies for test files' | ||
| retryCountOnTaskFailure: 10 | ||
| inputs: | ||
| workingDirectory: ${{ parameters.testWorkspace }} | ||
| targetType: 'inline' | ||
| script: 'npm install' | ||
| script: 'pnpm install --no-frozen-lockfile' | ||
Abe27342 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| - ${{ if eq(parameters.cacheCompatVersionsInstalls, true) }}: | ||
| - task: Cache@2 | ||
|
|
@@ -344,7 +339,7 @@ stages: | |
| continueOnError: true | ||
| inputs: | ||
| key: '"compat-version-installs" | "$(Agent.OS)" | "${{ parameters.testCommand }}" | "${{ variant.name }}"' | ||
| path: ${{ parameters.testWorkspace }}/node_modules/@fluid-private/test-version-utils/node_modules/.legacy/ | ||
| path: $(Build.SourcesDirectory)/node_modules/@fluid-private/test-version-utils/node_modules/.legacy/ | ||
|
|
||
| # Only check out tenants from the tenant pool if we are running tests against ODSP | ||
| - ${{ if or(eq(parameters.stageId, 'e2e_odsp'), eq(parameters.stageId, 'stress_tests_odsp')) }}: | ||
|
|
@@ -367,13 +362,12 @@ stages: | |
| env: | ||
| SYSTEM_ACCESSTOKEN: $(System.AccessToken) | ||
| inputs: | ||
| workingDirectory: ${{ parameters.testWorkspace }} | ||
| targetType: 'inline' | ||
| script: | | ||
| set -eu -o pipefail | ||
|
|
||
| # Increase the maximum time to wait for a tenant to 1 hour to accommodate multiple test runs at the same time. | ||
| npx --package=@ff-internal/trips-setup@0.0.5 -- trips-setup --waitTime=3600 --accessToken=$SYSTEM_ACCESSTOKEN | ||
| pnpm exec trips-setup -- --waitTime=3600 --accessToken=$SYSTEM_ACCESSTOKEN | ||
| echo "##vso[task.setvariable variable=tenantSetupSuccess;]true" | ||
|
|
||
| # run the test | ||
|
|
@@ -388,7 +382,7 @@ stages: | |
| login__microsoft__clientId: $(appClientId) | ||
| inputs: | ||
| command: 'custom' | ||
| workingDir: ${{ parameters.testWorkspace }}/node_modules/${{ parameters.testPackage }} | ||
| workingDir: $(Build.SourcesDirectory)/node_modules/${{ parameters.testPackage }} | ||
| customCommand: 'run ${{ parameters.testCommand }} -- ${{ variant.flags }}' | ||
|
|
||
| - ${{ if eq(parameters.skipTestResultPublishing, false) }}: | ||
|
|
@@ -430,7 +424,7 @@ stages: | |
| - task: PublishPipelineArtifact@1 | ||
| displayName: Publish Artifact - Tinylicious Log | ||
| inputs: | ||
| targetPath: '${{ parameters.testWorkspace }}/node_modules/${{ parameters.testPackage }}/tinylicious.log' | ||
| targetPath: '$(Build.SourcesDirectory)/node_modules/${{ parameters.testPackage }}/tinylicious.log' | ||
| artifactName: 'tinyliciousLog_attempt-$(System.JobAttempt)' | ||
| publishLocation: 'pipeline' | ||
| condition: always() | ||
|
|
@@ -461,8 +455,7 @@ stages: | |
| targetType: 'inline' | ||
| script: | | ||
| set -eu -o pipefail | ||
|
|
||
| npx --package=@ff-internal/[email protected] -- trips-cleanup --reservationId=$(stringBearerToken) | ||
| pnpm exec trips-cleanup -- --reservationId=$(stringBearerToken) | ||
| condition: eq(variables['tenantSetupSuccess'], 'true') | ||
|
|
||
| # Log Test Failures | ||
|
|
@@ -479,4 +472,4 @@ stages: | |
| stageId: ${{ parameters.stageId }} | ||
| uploadTestPassRateTelemetry: ${{ parameters.uploadTestPassRateTelemetry }} | ||
| pipelineIdentifierForTelemetry: ${{ parameters.pipelineIdentifierForTelemetry }} | ||
| testWorkspace: ${{ parameters.testWorkspace }} | ||
| testWorkspace: $(Build.SourcesDirectory) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the logger installed by default when the pipeline host repo is checked out?