Skip to content

Enable azdev for Azure/azure-cli CI automation test#188

Merged
haroldrandom merged 7 commits intoAzure:masterfrom
haroldrandom:onboard-pytest
Apr 24, 2020
Merged

Enable azdev for Azure/azure-cli CI automation test#188
haroldrandom merged 7 commits intoAzure:masterfrom
haroldrandom:onboard-pytest

Conversation

@haroldrandom
Copy link
Contributor

@haroldrandom haroldrandom commented Apr 23, 2020

  1. Refine the logic of testing against different profiles with ProfileContext
  2. pytest version limit change to pytest>=4.4.0
  3. Use AzureDevOpsContext to apply incremental test strategy.
  4. Refine the main flow of azdev test to be more compact and clean

To apply incremental test logic on Azure CLI test:

if [[ "$PULL_REQUEST_TARGET_BRANCH" != "System.PullRequestTargetBrancg" ]]; then
  azdev test --series --repo=./ --src=HEAD --tgt="$PULL_REQUEST_TARGET_BRANCH" --cli-ci --profile "$TARGET_PROFILE"
else
  azdev test --series  # will run all tests
fi

Test:

Listed #188

@haroldrandom haroldrandom changed the title Enable azdev for Azure/azure-cli CI Enable azdev for Azure/azure-cli CI automation test Apr 23, 2020
@haroldrandom haroldrandom self-assigned this Apr 23, 2020
@haroldrandom haroldrandom added CI Continuous Integration Test azdev test labels Apr 23, 2020
@haroldrandom haroldrandom requested a review from Juliehzl April 23, 2020 08:02
Copy link
Member

@qianwens qianwens left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:


arguments = ['-p', 'no:warnings', '--no-print-logs', '--junit-xml', log_path]
if os.name == 'posix':
arguments = ['-x', '-v', '--boxed', '-p no:warnings', '--log-level=WARN', '--junit-xml', log_path]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The added -x argument means:

-x, --exitfirst Exit instantly on first error or failed test
https://docs.pytest.org/en/7.3.x/reference/reference.html#command-line-flags

This is a breaking change to the original behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Continuous Integration Test azdev test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

support incremental test like old azdev in CI env pytest 5.0.1 which is incompatible for azdev 0.1.3

3 participants