From 71840e5f1dd483685166d958734cda5a68dc454e Mon Sep 17 00:00:00 2001 From: Qi Luo Date: Wed, 9 Mar 2022 12:03:00 -0800 Subject: [PATCH] [build] stop vstest in the Azure pipeline (#2097) stop vstest in the Azure pipeline --- .../build-docker-sonic-vs-template.yml | 63 -------------- .../test-docker-sonic-vs-template.yml | 87 ------------------- azure-pipelines.yml | 16 ---- 3 files changed, 166 deletions(-) delete mode 100644 .azure-pipelines/build-docker-sonic-vs-template.yml delete mode 100644 .azure-pipelines/test-docker-sonic-vs-template.yml diff --git a/.azure-pipelines/build-docker-sonic-vs-template.yml b/.azure-pipelines/build-docker-sonic-vs-template.yml deleted file mode 100644 index 37e2fde751..0000000000 --- a/.azure-pipelines/build-docker-sonic-vs-template.yml +++ /dev/null @@ -1,63 +0,0 @@ -parameters: -- name: timeout - type: number - default: 60 - -- name: artifact_name - type: string - -jobs: -- job: - displayName: "docker-sonic-vs" - timeoutInMinutes: ${{ parameters.timeout }} - - pool: - vmImage: 'ubuntu-20.04' - - steps: - - task: DownloadPipelineArtifact@2 - inputs: - artifact: wheels - displayName: "Download sonic utilities artifact" - - - task: DownloadPipelineArtifact@2 - inputs: - source: specific - project: build - pipeline: 15 - artifact: ${{ parameters.artifact_name }} - runVersion: 'latestFromBranch' - runBranch: 'refs/heads/202012' - displayName: "Download docker-sonic-vs artifact" - - - script: | - set -ex - - echo $(Build.DefinitionName).$(Build.BuildNumber) - - docker load < ../docker-sonic-vs.gz - - docker images "docker-sonic-vs" - - image_id=$(docker images "docker-sonic-vs:Azure.sonic-swss*" -q) - - docker tag ${image_id} docker-sonic-vs:latest - - docker images "docker-sonic-vs" - - mkdir -p .azure-pipelines/docker-sonic-vs/wheels - - cp -v ../*.whl .azure-pipelines/docker-sonic-vs/wheels - - pushd .azure-pipelines - - docker build --no-cache -t docker-sonic-vs:$(Build.DefinitionName).$(Build.BuildNumber) docker-sonic-vs - - popd - - docker save docker-sonic-vs:$(Build.DefinitionName).$(Build.BuildNumber) | gzip -c > $(Build.ArtifactStagingDirectory)/docker-sonic-vs.gz - displayName: "Build docker-sonic-vs image" - - - publish: $(Build.ArtifactStagingDirectory)/ - artifact: ${{ parameters.artifact_name }} - displayName: "Archive sonic docker vs image" diff --git a/.azure-pipelines/test-docker-sonic-vs-template.yml b/.azure-pipelines/test-docker-sonic-vs-template.yml deleted file mode 100644 index e0e6cbbd03..0000000000 --- a/.azure-pipelines/test-docker-sonic-vs-template.yml +++ /dev/null @@ -1,87 +0,0 @@ -parameters: -- name: timeout - type: number - default: 180 - -- name: log_artifact_name - type: string - -jobs: -- job: - displayName: vstest - timeoutInMinutes: ${{ parameters.timeout }} - - pool: - vmImage: 'ubuntu-20.04' - - steps: - - task: DownloadPipelineArtifact@2 - inputs: - artifact: docker-sonic-vs - displayName: "Download docker sonic vs image" - - - task: DownloadPipelineArtifact@2 - inputs: - source: specific - project: build - pipeline: 9 - artifact: sonic-swss-common.amd64.ubuntu20_04 - runVersion: 'latestFromBranch' - runBranch: 'refs/heads/202012' - displayName: "Download sonic swss common deb packages" - - - task: DownloadPipelineArtifact@2 - inputs: - source: specific - project: build - pipeline: 15 - artifact: sonic-swss-pytests - runVersion: 'latestFromBranch' - runBranch: 'refs/heads/202012' - displayName: "Download sonic swss pytests" - - - checkout: self - displayName: "Checkout sonic-utilities" - - - script: | - set -x - sudo .azure-pipelines/build_and_install_module.sh - - sudo apt-get install -y libhiredis0.14 - sudo dpkg -i --force-confask,confnew ../libswsscommon_1.0.0_amd64.deb || apt-get install -f - sudo dpkg -i ../python3-swsscommon_1.0.0_amd64.deb - - # install packages for vs test - sudo apt-get install -y net-tools bridge-utils vlan - sudo apt-get install -y python3-pip - sudo pip3 install pytest==4.6.2 attrs==19.1.0 exabgp==4.0.10 distro==1.5.0 docker==4.4.1 redis==3.3.4 flaky==3.7.0 - displayName: "Install dependencies" - - - script: | - set -x - sudo docker load -i ../docker-sonic-vs.gz - docker ps - ip netns list - cd ../ - mkdir -p sonic-swss - pushd sonic-swss - tar xf ../pytest.tgz - pushd tests - sudo py.test -v --force-flaky --junitxml=tr.xml --imgname=docker-sonic-vs:$(Build.DefinitionName).$(Build.BuildNumber) - displayName: "Run vs tests" - - - task: PublishTestResults@2 - inputs: - testResultsFiles: '**/tr.xml' - testRunTitle: vstest - condition: always() - - - script: | - cp -r ../sonic-swss/tests/log $(Build.ArtifactStagingDirectory)/ - displayName: "Collect logs" - condition: always() - - - publish: $(Build.ArtifactStagingDirectory)/ - artifact: ${{ parameters.log_artifact_name }}@$(System.JobAttempt) - displayName: "Publish logs" - condition: always() diff --git a/azure-pipelines.yml b/azure-pipelines.yml index c859340bae..ec1644bbfd 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -106,19 +106,3 @@ stages: - publish: '$(System.DefaultWorkingDirectory)/dist/' artifact: wheels displayName: "Publish Python wheels" - -- stage: BuildDocker - dependsOn: Build - condition: succeeded('Build') - jobs: - - template: .azure-pipelines/build-docker-sonic-vs-template.yml - parameters: - artifact_name: docker-sonic-vs - -- stage: Test - dependsOn: BuildDocker - condition: succeeded('BuildDocker') - jobs: - - template: .azure-pipelines/test-docker-sonic-vs-template.yml - parameters: - log_artifact_name: log