-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
feat (CI): Enable 1JS VR tool to run on v7 #25946
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
e730121
feat: add yaml configs to run new VR tool in v7
TristanWatanabe f261920
feat: add convert and test:component scripts
TristanWatanabe 013c0be
add 1JS VR tool dependencies
TristanWatanabe f75685b
fix: use correct package name
TristanWatanabe b636321
add build-storybook and screener:build scripts
TristanWatanabe 8b8b2f1
nit: rename screener:build to vrt:build
TristanWatanabe 6edbb80
chore: upgrade agent machine to use node 14
TristanWatanabe f0c793a
fix: use fixed node 14 version to align with master
TristanWatanabe 4920c77
remove unneeded check package affected
TristanWatanabe ebc7cd7
fix: remove condition
TristanWatanabe 507b160
rename baseline pipeline and update BASELINE-PIPELINE-ID
TristanWatanabe 4902ccf
test
TristanWatanabe a1ca35d
Revert "test"
TristanWatanabe 944b7e7
nit: import Keys for one test
TristanWatanabe 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 contains 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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
parameters: | ||
- name: fluentVersion | ||
type: string | ||
default: v7 | ||
- name: vrTestPackageName | ||
type: string | ||
default: 'vr-tests' | ||
- name: vrTestPackagePath | ||
type: string | ||
default: 'apps/vr-tests' | ||
|
||
steps: | ||
- task: Bash@3 | ||
inputs: | ||
filePath: yarn-ci.sh | ||
displayName: yarn (install packages) | ||
|
||
- script: | | ||
yarn workspace ${{ parameters.vrTestPackageName }} convert | ||
displayName: Convert screener component to storywright | ||
|
||
- script: | | ||
yarn workspace ${{ parameters.vrTestPackageName }} vrt:build | ||
displayName: Build VR tests components package | ||
|
||
- script: | | ||
yarn workspace ${{ parameters.vrTestPackageName }} test:component --verbose | ||
displayName: 'Run VR tests' | ||
|
||
- script: | | ||
mkdir -p screenshots | ||
cp -rf ${{ parameters.vrTestPackagePath }}/dist/screenshots/*.png screenshots/ | ||
displayName: Collate Artifacts | ||
|
||
- task: PublishBuildArtifacts@1 | ||
inputs: | ||
PathtoPublish: 'screenshots' | ||
ArtifactName: 'vrscreenshot${{ parameters.fluentVersion }}' | ||
publishLocation: 'Container' |
This file contains 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 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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env bash | ||
|
||
#!/usr/bin/env bash | ||
|
||
find ./src -type f |while read fname; do | ||
impor="" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. impor is a strange name There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Will address in follow-up PRs with cleanups! |
||
if grep -q "screener-storybook" $fname; then | ||
echo "$fname" | ||
if grep -q "<Screener" $fname; then | ||
impor="${impor}StoryWright, " | ||
fi | ||
if grep -q "Steps(" $fname; then | ||
impor="${impor}Steps, " | ||
fi | ||
if grep "Step " $fname; then | ||
impor="${impor}Step , " | ||
fi | ||
if grep "Keys " $fname; then | ||
impor="${impor}Keys , " | ||
fi | ||
fi | ||
impor="${impor%??}" | ||
sed -i "s/import.*screener'/import { ${impor} } from 'storywright'/g" $fname | ||
done | ||
|
||
find ./src -type f | xargs sed -i "s/Screener.Steps/Steps/g" | ||
find ./src -type f | xargs sed -i "s/<Screener/<StoryWright/g" | ||
find ./src -type f | xargs sed -i "s/Screener>/StoryWright>/g" | ||
|
This file contains 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 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 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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
trigger: | ||
batch: true | ||
branches: | ||
include: | ||
- 7.0 | ||
|
||
variables: | ||
skipComponentGovernanceDetection: true | ||
|
||
pool: '1ES-Host-Ubuntu' | ||
|
||
jobs: | ||
- job: VRToolUpdateBaseline_V7 | ||
workspace: | ||
clean: all | ||
steps: | ||
- template: .devops/templates/tools.yml | ||
|
||
- template: .devops/templates/runpublishvrscreenshot.yml | ||
parameters: | ||
fluentVersion: v7 | ||
vrTestPackageName: 'vr-tests' | ||
vrTestPackagePath: 'apps/vr-tests' | ||
|
||
- bash: node node_modules/vrscreenshotdiff/lib/index.js release --clientType "FluentUI-v7" --buildId $(Build.BuildId) | ||
displayName: 'Run Screenshotdiff update baseline' | ||
env: | ||
API_URL: $(System.CollectionUri) | ||
API_TOKEN: $(fabric-public-pipeline-access-PAT) | ||
API_REPOSITORY: $(Build.Repository.Name) | ||
API_PROJECT: $(System.TeamProject) | ||
SCREENSHOT_ARTIFACT_FOLDER: vrscreenshotv7 | ||
GITHUB_API_TOKEN: $(githubRepoStatusPAT) | ||
STORAGE_ACCOUNT_FLUENTUI: $(STORAGE-ACCOUNT-FLUENTUI) | ||
STORAGE_KEY_FLUENTUI: $(STORAGE-KEY-BLOB-FLUENTUI) | ||
BLOB_CONNECTION_STRING: $(BLOB-CONNECTION-STRING) | ||
VR_APPROVAL_CLIENT_SECRET: $(VRClientSecret) | ||
VR_APPROVAL_HOST: $(VR_APPROVAL_HOST) |
This file contains 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 |
---|---|---|
@@ -0,0 +1,93 @@ | ||
pr: | ||
- 7.0 | ||
|
||
trigger: none | ||
|
||
variables: | ||
- ${{ if not(startsWith(variables['Build.SourceBranch'], 'refs/heads/')) }}: | ||
- name: sinceArg | ||
value: --since $(targetBranch) | ||
|
||
- template: .devops/templates/variables.yml | ||
|
||
pool: '1ES-Host-Ubuntu' | ||
|
||
jobs: | ||
- job: VisualRegressionTest_V7 | ||
variables: | ||
pipelineId: '314' | ||
pipelineName: 'fluent-ui VRT Pipeline v7' | ||
workspace: | ||
clean: all | ||
steps: | ||
- checkout: self | ||
fetchDepth: 0 | ||
|
||
- template: .devops/templates/tools.yml | ||
|
||
- bash: | | ||
postPolicy="true"; | ||
response=$(curl --request POST 'https://login.microsoftonline.com/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/token' --header 'Content-Type: application/x-www-form-urlencoded' --data-urlencode 'grant_type=client_credentials' --data-urlencode 'client_id=288a69b6-760d-4c1f-ad6d-0183b5e5740f' --data-urlencode 'client_secret='${VR_APPROVAL_CLIENT_SECRET} ) | ||
parsedResponse=${response/*"access_token"/} | ||
token=${parsedResponse:3:${#parsedResponse}-5} | ||
curl --location --request POST 'https://vrt-fluentapp.azurewebsites.net/api/policyState' \ | ||
--header 'Authorization: Bearer '"$token" \ | ||
--header 'Content-Type: application/json' \ | ||
--data-raw ' { | ||
"organization": "uifabric", | ||
"projectName": "fabricpublic", | ||
"prId": $(System.PullRequest.PullRequestNumber), | ||
"commitId": "$(Build.SourceVersion)", | ||
"generate":true, | ||
"blockingPipeline":{ | ||
}, | ||
"nonBlockingPipeline":{ | ||
"$(pipelineId)": { | ||
"pipelineStatus": "PENDING", | ||
"pipelineName": "$(pipelineName)" | ||
} | ||
}, | ||
"postPolicy": '${postPolicy}', | ||
"policyType": "OPTIONAL" | ||
}' | ||
displayName: 'Call policy State Api' | ||
env: | ||
VR_APPROVAL_CLIENT_SECRET: $(VR-APPROVAL-CLIENT-SECRET) | ||
VR_APPROVAL_HOST: $(VR_APPROVAL_HOST) | ||
|
||
- template: .devops/templates/runpublishvrscreenshot.yml | ||
parameters: | ||
fluentVersion: v7 | ||
vrTestPackageName: 'vr-tests' | ||
vrTestPackagePath: 'apps/vr-tests' | ||
|
||
- powershell: | | ||
$url = "https://dev.azure.com/uifabric/fabricpublic/_apis/build/builds?definitions=$env:BASELINE_PIPELINE_ID&statusFilter=completed&resultFilter=succeeded&queryOrder=finishTimeDescending&`$top=1" | ||
Write-Host "Looking up latest official build via url: $url" | ||
$pipelineBuildInfo = Invoke-RestMethod -Uri $url -Headers @{Authorization = "Bearer $env:SYSTEM_ACCESSTOKEN"} | ||
Write-Host "Response: $pipelineBuildInfo" | ||
[int]$latestBuildId = $pipelineBuildInfo.value.id | ||
Write-Host "Setting variable LatestBuildId=$latestBuildId" | ||
Write-Host "##vso[task.setvariable variable=LatestBuildId]$latestBuildId" | ||
name: GetLatestGreenCIBuild | ||
env: | ||
SYSTEM_ACCESSTOKEN: $(System.AccessToken) | ||
BASELINE_PIPELINE_ID: $(BASELINE-PIPELINE-ID-V7) | ||
|
||
- bash: node node_modules/vrscreenshotdiff/lib/index.js pr --clientType "FluentUI-v7" --buildId $(Build.BuildId) --lkgCIBuild $(LatestBuildId) --pipelineId $(pipelineId) --pipelineName '$(pipelineName)' | ||
displayName: 'Run fluentui-screenshotdiff' | ||
env: | ||
API_URL: $(System.CollectionUri) | ||
API_TOKEN: $(fabric-public-pipeline-access-PAT) | ||
API_REPOSITORY: $(Build.Repository.Name) | ||
API_PROJECT: $(System.TeamProject) | ||
SCREENSHOT_ARTIFACT_FOLDER: vrscreenshotv7 | ||
GITHUB_API_TOKEN: $(githubRepoStatusPAT) | ||
STORAGE_ACCOUNT_FLUENTUI: $(STORAGE-ACCOUNT-FLUENTUI) | ||
STORAGE_KEY_FLUENTUI: $(STORAGE-KEY-BLOB-FLUENTUI) | ||
BLOB_CONNECTION_STRING: $(BLOB-CONNECTION-STRING) | ||
VR_APPROVAL_CLIENT_SECRET: $(VRClientSecret) | ||
GITHUB_REPO_OWNER: 'microsoft' | ||
GITHUB_REPO_NAME: 'fluentui' | ||
VR_APPROVAL_HOST: $(VR_APPROVAL_HOST) | ||
VR_APP_NAME: $(VR_APP_NAME) |
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.
bumps agent host machine
node
version to14.18.1
to align with master and to make it compatible with thestorywright
tool.