# pyocd functional test pipeline trigger: branches: include: - '*' paths: include: - '.azure' - 'pyocd' - 'test' - 'pyproject.toml' - 'setup.cfg' - 'setup.py' pr: branches: include: - '*' paths: include: - '.azure' - 'pyocd' - 'test' - 'pyproject.toml' - 'setup.cfg' - 'setup.py' jobs: - job: functional_tests displayName: "Functional tests" timeoutInMinutes: 200 # Fully clean workspaces before testing. workspace: clean: all # Matrix. strategy: matrix: Mac: test_os: Darwin Linux: test_os: Linux Win: test_os: Windows_NT # Agent pool and requirements. pool: name: functional-test demands: - Agent.OS -equals $(test_os) steps: # Configure shallow checkout. - checkout: self fetchDepth: 1 # Linux/Mac: Activate venv and install dependencies. - script: | python3 -m venv .venv source .venv/bin/activate python -m pip install --upgrade pip setuptools wheel pip install .[test] name: install_dependencies_posix displayName: 'Install dependencies (Posix)' condition: and(in(variables['agent.os'], 'Darwin', 'Linux'), succeeded()) # Windows: Activate venv and install dependencies. - script: | python -m venv .venv call .venv\Scripts\activate.bat python -m pip install --upgrade pip setuptools wheel pip install .[test] name: install_dependencies_win displayName: 'Install dependencies (Win)' condition: and(eq(variables['agent.os'], 'Windows_NT'), succeeded()) # Download pyocd.yaml config file into test directory. - task: UniversalPackages@0 name: install_test_config inputs: command: download vstsFeed: 'pyocd/config' vstsFeedPackage: 'pyocd-test-config' vstsPackageVersion: '*' downloadDirectory: 'test' verbosity: 'debug' displayName: 'Install test config' # Linux/Mac: Activate venv and run automated test suite. - script: | source .venv/bin/activate cd test python ./automated_test.py --quiet name: run_tests_posix displayName: 'Run tests (Posix)' condition: and(in(variables['agent.os'], 'Darwin', 'Linux'), succeeded()) # Windows: Activate venv and run automated test suite. - script: | call .venv\Scripts\activate.bat cd test python automated_test.py --quiet name: run_tests_win displayName: 'Run tests (Win)' condition: and(eq(variables['agent.os'], 'Windows_NT'), succeeded()) # Publish JUnit-format test results. - task: PublishTestResults@2 inputs: testResultsFiles: test/output/*.xml testRunTitle: "$(Agent.OS) functional tests" platform: "$(Agent.OS)" # Doesn't show up anywhere in Azure UI. condition: succeededOrFailed() displayName: "Publish test results" # Publish test outputs. - task: PublishPipelineArtifact@1 inputs: targetPath: "test/output" artifactName: outputs_$(test_os) condition: succeededOrFailed() displayName: "Publish test output files"