-
Notifications
You must be signed in to change notification settings - Fork 342
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
Test fix ups #45
Merged
+47
−35
Merged
Test fix ups #45
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
1232c29
Enable coverage tests
jillr 34856cd
Put venv back into coverage block
jillr 637a8dc
Fix repo name in check_matrix.py
jillr b89269e
Use codecov pip module instead of codecov-bash
jillr 166a357
ci_complete
jillr 426ba67
ci_coverage
jillr 0633994
Fix a path in coverage reports
jillr 4a7923d
ci_coverage
jillr 9424d76
ci_complete
jillr 3eb8d5a
ci_coverage
jillr 2cbcfd1
Relocate venv in shippable.sh
jillr 23fc638
ci_coverage
jillr 8eaaac2
cant repro problem locally?
jillr 6d90066
add -x to cleanup func.
jillr 7947658
ci_coverage
jillr a885f61
why does this var seem empty?
jillr f9d7b86
Dsiable smoketests from collections
jillr e6ae537
Missed a smoketest-related line in aws.sh
jillr b92056d
Give codecov -r option
jillr 3c5f774
ci_complete
jillr ab3a7e6
Try going back to codecov bash uploader
jillr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
cloud/aws | ||
shippable/aws/group2 | ||
shippable/aws/smoketest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,20 +34,20 @@ export PATH="${PWD}/bin:${PATH}" | |
export PYTHONIOENCODING='utf-8' | ||
|
||
if [ "${JOB_TRIGGERED_BY_NAME:-}" == "nightly-trigger" ]; then | ||
# COVERAGE=yes | ||
COVERAGE=yes | ||
COMPLETE=yes | ||
fi | ||
|
||
#if [ -n "${COVERAGE:-}" ]; then | ||
# # on-demand coverage reporting triggered by setting the COVERAGE environment variable to a non-empty value | ||
# export COVERAGE="--coverage" | ||
#elif [[ "${COMMIT_MESSAGE}" =~ ci_coverage ]]; then | ||
# # on-demand coverage reporting triggered by having 'ci_coverage' in the latest commit message | ||
# export COVERAGE="--coverage" | ||
#else | ||
# # on-demand coverage reporting disabled (default behavior, always-on coverage reporting remains enabled) | ||
# export COVERAGE="--coverage-check" | ||
#fi | ||
if [ -n "${COVERAGE:-}" ]; then | ||
# on-demand coverage reporting triggered by setting the COVERAGE environment variable to a non-empty value | ||
export COVERAGE="--coverage" | ||
elif [[ "${COMMIT_MESSAGE}" =~ ci_coverage ]]; then | ||
# on-demand coverage reporting triggered by having 'ci_coverage' in the latest commit message | ||
export COVERAGE="--coverage" | ||
else | ||
# on-demand coverage reporting disabled (default behavior, always-on coverage reporting remains enabled) | ||
export COVERAGE="--coverage-check" | ||
fi | ||
|
||
if [ -n "${COMPLETE:-}" ]; then | ||
# disable change detection triggered by setting the COMPLETE environment variable to a non-empty value | ||
|
@@ -92,6 +92,7 @@ ansible-galaxy collection install ansible.netcommon | |
cd "${cwd}" | ||
|
||
export ANSIBLE_COLLECTIONS_PATHS="${HOME}/.ansible/" | ||
SHIPPABLE_RESULT_DIR="$(pwd)/shippable" | ||
TEST_DIR="${HOME}/.ansible/collections/ansible_collections/amazon/aws/" | ||
mkdir -p "${TEST_DIR}" | ||
cp -aT "${SHIPPABLE_BUILD_DIR}" "${TEST_DIR}" | ||
|
@@ -109,21 +110,48 @@ function cleanup | |
fi | ||
|
||
# shellcheck disable=SC2086 | ||
ansible-test coverage xml --color -v --requirements --group-by command --group-by version ${stub:+"$stub"} | ||
cp -a tests/output/reports/coverage=*.xml shippable/codecoverage/ | ||
ansible-test coverage xml --color --requirements --group-by command --group-by version ${stub:+"$stub"} | ||
cp -a tests/output/reports/coverage=*.xml "$SHIPPABLE_RESULT_DIR/codecoverage/" | ||
|
||
# analyze and capture code coverage aggregated by integration test target | ||
ansible-test coverage analyze targets generate -v "$SHIPPABLE_RESULT_DIR/testresults/coverage-analyze-targets.json" | ||
|
||
# upload coverage report to codecov.io only when using complete on-demand coverage | ||
if [ "${COVERAGE}" == "--coverage" ] && [ "${CHANGED}" == "" ]; then | ||
for file in tests/output/reports/coverage=*.xml; do | ||
flags="${file##*/coverage=}" | ||
flags="${flags%-powershell.xml}" | ||
flags="${flags%.xml}" | ||
# remove numbered component from stub files when converting to tags | ||
flags="${flags//stub-[0-9]*/stub}" | ||
flags="${flags//=/,}" | ||
flags="${flags//[^a-zA-Z0-9_,]/_}" | ||
|
||
bash <(curl -s https://codecov.io/bash) \ | ||
-f "${file}" \ | ||
-F "${flags}" \ | ||
-n "${test}" \ | ||
-t bc371da7-e5d2-4743-93b5-309f81d457a4 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've checked this codecov key is correct |
||
-X coveragepy \ | ||
-X gcov \ | ||
-X fix \ | ||
-X search \ | ||
-X xcode \ | ||
|| echo "Failed to upload code coverage report to codecov.io: ${file}" | ||
done | ||
fi | ||
fi | ||
fi | ||
|
||
if [ -d tests/output/junit/ ]; then | ||
cp -aT tests/output/junit/ shippable/testresults/ | ||
cp -aT tests/output/junit/ "$SHIPPABLE_RESULT_DIR/testresults/" | ||
fi | ||
|
||
if [ -d tests/output/data/ ]; then | ||
cp -a tests/output/data/ shippable/testresults/ | ||
cp -a tests/output/data/ "$SHIPPABLE_RESULT_DIR/testresults/" | ||
fi | ||
|
||
if [ -d tests/output/bot/ ]; then | ||
cp -aT tests/output/bot/ shippable/testresults/ | ||
cp -aT tests/output/bot/ "$SHIPPABLE_RESULT_DIR/testresults/" | ||
fi | ||
} | ||
|
||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This really makes my skin crawl. Especially since we have a virtualenv we should be able to use the codecov package.
pip install --user codecov && codecov -t <the-repository-upload-token>
Looking at the code I think it supports the same flags.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They're not exactly the same. Digging into the source it looks like the python module does not support
coveragepy
, but I believepycov
should do the same thing.