Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -339,13 +339,22 @@ class PythonParallelTaskGenerator extends DefaultParallelTaskGenerator {
} finally {
steps.junit(allowEmptyResults: true,
keepLongStdio: true,
testResults: "**/python-agent-junit.xml,**/target/**/TEST-*.xml")
testResults: "**/python-agent-junit.xml,**/target/**/TEST-*.xml"
)
steps.env.PYTHON_VERSION = "${x}"
steps.env.WEBFRAMEWORK = "${y}"
steps.codecov(repo: "${steps.env.REPO}",
basedir: "${steps.env.BASE_DIR}",
flags: "-e PYTHON_VERSION,WEBFRAMEWORK",
secret: "${steps.env.CODECOV_SECRET}")
secret: "${steps.env.CODECOV_SECRET}"
)
dir("${steps.env.BASE_DIR}/tests"){
Copy link
Member

Choose a reason for hiding this comment

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

could this section be moved earlier? Just in case the codecov step failed then this section won't be executed, what do you think?

steps.archiveArtifacts(
allowEmptyArchive: true,
artifacts: '**/docker-info/**',
defaultExcludes: false
)
}
}
}
}
Expand Down
20 changes: 20 additions & 0 deletions tests/scripts/docker/docker-get-logs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env bash
set -euo pipefail

STEP=${1:-""}

DOCKER_INFO_DIR="docker-info/${STEP}"
mkdir -p ${DOCKER_INFO_DIR}
cp docker-compose.yml ${DOCKER_INFO_DIR}
cd ${DOCKER_INFO_DIR}

docker ps -a &> docker-containers.txt

DOCKER_IDS=$(docker ps -aq)

for id in ${DOCKER_IDS}
do
docker ps -af id=${id} --no-trunc &> ${id}-cmd.txt
docker logs ${id} &> ${id}.log || echo "It is not possible to grab the logs of ${id}"
docker inspect ${id} &> ${id}-inspect.json || echo "It is not possible to grab the inspect of ${id}"
done
19 changes: 19 additions & 0 deletions tests/scripts/docker/docker-summary.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash
set -euo pipefail

DOCKER_IDS=$(docker ps -aq)

for id in ${DOCKER_IDS}
do
echo "***********************************************************"
echo "***************Docker Container ${id}***************"
echo "***********************************************************"
docker ps -af id=${id} --no-trunc
echo "----"
docker logs ${id} | tail -n 10 || echo "It is not possible to grab the logs of ${id}"
done

echo "*******************************************************"
echo "***************Docker Containers Summary***************"
echo "*******************************************************"
docker ps -a
4 changes: 4 additions & 0 deletions tests/scripts/docker/run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@
set -ex

function cleanup {
if [ -n "${BUILD_NUMBER}" ]; then # only on CI
./scripts/docker/docker-summary.sh
./scripts/docker/docker-get-logs.sh "${1}-${2}"
fi
PYTHON_VERSION=${1} docker-compose down -v

if [[ $CODECOV_TOKEN ]]; then
Expand Down