Skip to content
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

[BUGFIX] Ensure proper exit code for dependency graph script #3839

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
50 changes: 50 additions & 0 deletions azure-pipelines-dependency-graph-testing.yml
Expand Up @@ -147,13 +147,23 @@ stages:
displayName: 'Install dependencies'

- script: |
# Install dependencies
pip install pytest pytest-cov pytest-azurepipelines

# Run script and save output to a temp file
echo "Tests identified by dependency graph test runner [dgtest]:"
python scripts/determine_tests_to_run.py --depth 3 --ignore 'tests/cli' 'tests/integration/usage_statistics' | tee .dgtest

# If the script found any matches, feed them into pytest
EXIT_STATUS=0
if [ -s .dgtest ]; then
cat .dgtest | xargs pytest $(GE_pytest_opts) --napoleon-docstrings --junitxml=junit/test-results.xml --cov=. --cov-report=xml --cov-report=html
EXIT_STATUS=$?
fi

# Clean up
rm .dgtest
exit $EXIT_STATUS
displayName: 'pytest'

- task: PublishTestResults@2
Expand Down Expand Up @@ -214,13 +224,23 @@ stages:
displayName: 'Install dependencies'

- script: |
# Install dependencies
pip install pytest pytest-cov pytest-azurepipelines

# Run script and save output to a temp file
echo "Tests identified by dependency graph test runner [dgtest]:"
python scripts/determine_tests_to_run.py --depth 3 --ignore 'tests/cli' 'tests/integration/usage_statistics' | tee .dgtest

# If the script found any matches, feed them into pytest
EXIT_STATUS=0
if [ -s .dgtest ]; then
cat .dgtest | xargs pytest $(GE_pytest_opts) --napoleon-docstrings --junitxml=junit/test-results.xml --cov=. --cov-report=xml --cov-report=html
EXIT_STATUS=$?
fi

# Clean up
rm .dgtest
exit $EXIT_STATUS
displayName: 'pytest'

- task: PublishTestResults@2
Expand Down Expand Up @@ -280,14 +300,24 @@ stages:
displayName: 'Install dependencies'

- script: |
# Install dependencies
pip install --requirement requirements.txt
pip install pytest pytest-cov pytest-azurepipelines

# Run script and save output to a temp file
echo "Tests identified by dependency graph test runner [dgtest]:"
python scripts/determine_tests_to_run.py --depth 3 --ignore 'tests/cli' 'tests/integration/usage_statistics' | tee .dgtest

# If the script found any matches, feed them into pytest
EXIT_STATUS=0
if [ -s .dgtest ]; then
cat .dgtest | xargs pytest --mysql --no-postgresql --no-spark --napoleon-docstrings --junitxml=junit/test-results.xml --cov=. --cov-report=xml --cov-report=html
EXIT_STATUS=$?
fi

# Clean up
rm .dgtest
exit $EXIT_STATUS
displayName: 'pytest'

- job: mssql
Expand Down Expand Up @@ -318,13 +348,23 @@ stages:
displayName: 'Install dependencies'

- script: |
# Install dependencies
pip install pytest pytest-cov pytest-azurepipelines

# Run script and save output to a temp file
echo "Tests identified by dependency graph test runner [dgtest]:"
python scripts/determine_tests_to_run.py --depth 3 --ignore 'tests/cli' 'tests/integration/usage_statistics' | tee .dgtest

# If the script found any matches, feed them into pytest
EXIT_STATUS=0
if [ -s .dgtest ]; then
cat .dgtest | xargs pytest --mssql --no-postgresql --no-spark --napoleon-docstrings --junitxml=junit/test-results.xml --cov=. --cov-report=xml --cov-report=html
EXIT_STATUS=$?
fi

# Clean up
rm .dgtest
exit $EXIT_STATUS
displayName: 'pytest'

- stage: cli_integration
Expand Down Expand Up @@ -363,11 +403,21 @@ stages:
displayName: 'Install dependencies'

- script: |
# Install dependencies
pip install pytest pytest-azurepipelines

# Run script and save output to a temp file
echo "Tests identified by dependency graph test runner [dgtest]:"
python scripts/determine_tests_to_run.py --filter 'tests/cli' --depth 3 | tee .dgtest

# If the script found any matches, feed them into pytest
EXIT_STATUS=0
if [ -s .dgtest ]; then
cat .dgtest | xargs pytest --aws-integration -v
EXIT_STATUS=$?
fi

# Clean up
rm .dgtest
exit $EXIT_STATUS
displayName: 'pytest'