From ecbde6f8fe082f427c44880204927fa9949d38eb Mon Sep 17 00:00:00 2001 From: Faith Kangai Date: Wed, 24 Apr 2024 12:49:23 +0300 Subject: [PATCH] debug script --- pipelines/snippets.yml | 206 +++++++++++++++++++++-------------------- 1 file changed, 108 insertions(+), 98 deletions(-) diff --git a/pipelines/snippets.yml b/pipelines/snippets.yml index b08167311..57541257f 100644 --- a/pipelines/snippets.yml +++ b/pipelines/snippets.yml @@ -25,17 +25,17 @@ pool: vmImage: 'ubuntu-latest' -parameters: - - name: snippetLanguages - type: object - default: ['C#', 'CLI', 'Go', 'Java', 'JavaScript', 'PHP', 'PowerShell', 'Python'] # should be ordered alphabetically - displayName: 'Languages to generate snippets for' - -variables: - buildConfiguration: 'Release' - apidoctorPath: 'microsoft-graph-devx-api/apidoctor' - apidoctorProjects: '$(apidoctorPath)/**/*.csproj' - snippetLanguages: ${{ join(',',parameters.snippetLanguages) }} +# parameters: +# - name: snippetLanguages +# type: object +# default: ['C#', 'CLI', 'Go', 'Java', 'JavaScript', 'PHP', 'PowerShell', 'Python'] # should be ordered alphabetically +# displayName: 'Languages to generate snippets for' + +# variables: +# buildConfiguration: 'Release' +# apidoctorPath: 'microsoft-graph-devx-api/apidoctor' +# apidoctorProjects: '$(apidoctorPath)/**/*.csproj' +# snippetLanguages: ${{ join(',',parameters.snippetLanguages) }} stages: - stage: GenerateSnippets @@ -81,102 +81,112 @@ stages: projects: 'microsoft-graph-devx-api/CodeSnippetsReflection.App/CodeSnippetsReflection.App.csproj' arguments: '--configuration $(buildConfiguration)' - - task: DotNetCoreCLI@2 - displayName: 'Restore packages for APIDoctor' - inputs: - command: 'restore' - projects: '$(Build.SourcesDirectory)/$(apidoctorProjects)' - - - task: DotNetCoreCLI@2 - displayName: 'Build APIDoctor' - inputs: - command: 'build' - projects: '$(Build.SourcesDirectory)/$(apidoctorProjects)' - arguments: '--configuration $(buildConfiguration)' - - - pwsh: | - # release folder can change based on .NET core version, so search recursively in bin folder - $snippetGeneratorPath = (Get-ChildItem $env:BUILD_SOURCESDIRECTORY/microsoft-graph-devx-api/CodeSnippetsReflection.App/bin/Release *App -Recurse).FullName - Write-Host "Path to snippet generator tool: $snippetGeneratorPath" - - $apidoctorPath = (Get-ChildItem $env:BUILD_SOURCESDIRECTORY/microsoft-graph-devx-api/apidoctor/ApiDoctor.Console/bin/Release apidoc -Recurse).FullName - Write-Host "Path to apidoctor tool: $apidoctorPath" - - . $apidoctorPath generate-snippets --ignore-warnings --path . --snippet-generator-path $snippetGeneratorPath --temp-output-path $env:BUILD_ARTIFACTSTAGINGDIRECTORY/Snippets --lang $(snippetLanguages) --git-path "/bin/git" - displayName: 'Generate snippets' - workingDirectory: microsoft-graph-docs - - - task: PublishBuildArtifacts@1 - displayName: 'Publish snippets as artifact' - inputs: - PathtoPublish: '$(Build.ArtifactStagingDirectory)/Snippets' - ArtifactName: 'Snippets' - publishLocation: 'Container' - StoreAsTar: true - - - pwsh: $(Build.SourcesDirectory)/microsoft-graph-devx-api/scripts/cleanupUnusedSnippets.ps1 - displayName: 'Cleanup unused snippets' - workingDirectory: microsoft-graph-docs - - - template: templates/commit-changes.yml -- stage: RunTests - dependsOn: GenerateSnippets - displayName: Run tests - jobs: - - job: RunTests - strategy: - matrix: - 'HTTP v1 Stable': - SNIPPET_LANGUAGE: 'http' - GRAPH_VERSION: 'v1' - TEST_CATEGORY: 'Stable' - 'HTTP v1 KnownIssues': - SNIPPET_LANGUAGE: 'http' - GRAPH_VERSION: 'v1' - TEST_CATEGORY: 'KnownIssues' - 'HTTP beta Stable': - SNIPPET_LANGUAGE: 'http' - GRAPH_VERSION: 'beta' - TEST_CATEGORY: 'Stable' - 'HTTP beta KnownIssues': - SNIPPET_LANGUAGE: 'http' - GRAPH_VERSION: 'beta' - TEST_CATEGORY: 'KnownIssues' - ${{ each language in parameters.snippetLanguages }}: - '${{ language }} v1 Stable': - SNIPPET_LANGUAGE: ${{ lower(language) }} - GRAPH_VERSION: 'v1' - TEST_CATEGORY: 'Stable' - '${{ language }} v1 KnownIssues': - SNIPPET_LANGUAGE: ${{ lower(language) }} - GRAPH_VERSION: 'v1' - TEST_CATEGORY: 'KnownIssues' - '${{ language }} beta Stable': - SNIPPET_LANGUAGE: ${{ lower(language) }} - GRAPH_VERSION: 'beta' - TEST_CATEGORY: 'Stable' - '${{ language }} beta KnownIssues': - SNIPPET_LANGUAGE: ${{ lower(language) }} - GRAPH_VERSION: 'beta' - TEST_CATEGORY: 'KnownIssues' - steps: - - template: templates/run-tests.yml +# - task: DotNetCoreCLI@2 +# displayName: 'Restore packages for APIDoctor' +# inputs: +# command: 'restore' +# projects: '$(Build.SourcesDirectory)/$(apidoctorProjects)' + +# - task: DotNetCoreCLI@2 +# displayName: 'Build APIDoctor' +# inputs: +# command: 'build' +# projects: '$(Build.SourcesDirectory)/$(apidoctorProjects)' +# arguments: '--configuration $(buildConfiguration)' + +# - pwsh: | +# # release folder can change based on .NET core version, so search recursively in bin folder +# $snippetGeneratorPath = (Get-ChildItem $env:BUILD_SOURCESDIRECTORY/microsoft-graph-devx-api/CodeSnippetsReflection.App/bin/Release *App -Recurse).FullName +# Write-Host "Path to snippet generator tool: $snippetGeneratorPath" + +# $apidoctorPath = (Get-ChildItem $env:BUILD_SOURCESDIRECTORY/microsoft-graph-devx-api/apidoctor/ApiDoctor.Console/bin/Release apidoc -Recurse).FullName +# Write-Host "Path to apidoctor tool: $apidoctorPath" + +# . $apidoctorPath generate-snippets --ignore-warnings --path . --snippet-generator-path $snippetGeneratorPath --temp-output-path $env:BUILD_ARTIFACTSTAGINGDIRECTORY/Snippets --lang $(snippetLanguages) --git-path "/bin/git" +# displayName: 'Generate snippets' +# workingDirectory: microsoft-graph-docs + +# - task: PublishBuildArtifacts@1 +# displayName: 'Publish snippets as artifact' +# inputs: +# PathtoPublish: '$(Build.ArtifactStagingDirectory)/Snippets' +# ArtifactName: 'Snippets' +# publishLocation: 'Container' +# StoreAsTar: true + +# - pwsh: $(Build.SourcesDirectory)/microsoft-graph-devx-api/scripts/cleanupUnusedSnippets.ps1 +# displayName: 'Cleanup unused snippets' +# workingDirectory: microsoft-graph-docs + +# - template: templates/commit-changes.yml +# - stage: RunTests +# dependsOn: GenerateSnippets +# displayName: Run tests +# jobs: +# - job: RunTests +# strategy: +# matrix: +# 'HTTP v1 Stable': +# SNIPPET_LANGUAGE: 'http' +# GRAPH_VERSION: 'v1' +# TEST_CATEGORY: 'Stable' +# 'HTTP v1 KnownIssues': +# SNIPPET_LANGUAGE: 'http' +# GRAPH_VERSION: 'v1' +# TEST_CATEGORY: 'KnownIssues' +# 'HTTP beta Stable': +# SNIPPET_LANGUAGE: 'http' +# GRAPH_VERSION: 'beta' +# TEST_CATEGORY: 'Stable' +# 'HTTP beta KnownIssues': +# SNIPPET_LANGUAGE: 'http' +# GRAPH_VERSION: 'beta' +# TEST_CATEGORY: 'KnownIssues' +# ${{ each language in parameters.snippetLanguages }}: +# '${{ language }} v1 Stable': +# SNIPPET_LANGUAGE: ${{ lower(language) }} +# GRAPH_VERSION: 'v1' +# TEST_CATEGORY: 'Stable' +# '${{ language }} v1 KnownIssues': +# SNIPPET_LANGUAGE: ${{ lower(language) }} +# GRAPH_VERSION: 'v1' +# TEST_CATEGORY: 'KnownIssues' +# '${{ language }} beta Stable': +# SNIPPET_LANGUAGE: ${{ lower(language) }} +# GRAPH_VERSION: 'beta' +# TEST_CATEGORY: 'Stable' +# '${{ language }} beta KnownIssues': +# SNIPPET_LANGUAGE: ${{ lower(language) }} +# GRAPH_VERSION: 'beta' +# TEST_CATEGORY: 'KnownIssues' +# steps: +# - template: templates/run-tests.yml - stage: GenerateRunTestReports - dependsOn: RunTests + dependsOn: GenerateSnippets displayName: GenerateRunTestReports jobs: - job: GenerateCategorizationReport steps: - - task: DownloadPipelineArtifact@2 - displayName: 'Download RunTests artifact' - inputs: - artifact: 'Generation Test Results' - path: '$(Build.ArtifactStagingDirectory)/TestResults' + - checkout: self + displayName: checkout GE api + fetchDepth: 1 + submodules: recursive + persistCredentials: true + # - task: DownloadPipelineArtifact@2 + # displayName: 'Download RunTests artifact' + # inputs: + # artifact: 'Generation Test Results' + # path: '$(Build.ArtifactStagingDirectory)/TestResults' + + - pwsh: | + echo pwd + ls $(Build.SourcesDirectory)/microsoft-graph-devx-api + workingDirectory: '$(Build.SourcesDirectory)' - pwsh: | ./microsoft-graph-devx-api/scripts/categorizeErrors.ps1 -trxFolderPath '$(Build.ArtifactStagingDirectory)/TestResults/' -txtOutputFolderPath '$(Build.ArtifactStagingDirectory)/TestResults/Reports/' displayName: Generate error category report - workingDirectory: $(Build.SourcesDirectory) + workingDirectory: '$(Build.SourcesDirectory)' - task: PublishBuildArtifacts@1 displayName: 'Publish categorization report as artifact'