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

Add possibility to execute arbitrary scripts after test execution #566

Merged
merged 5 commits into from
Dec 7, 2022

Conversation

S7evinK
Copy link
Contributor

@S7evinK S7evinK commented Dec 2, 2022

This can be useful to extract coverage logs or database files to further examine failing tests.

Example script:

#!/bin/bash

echo "Params: $@";

if [[ $3 == "false" ]]; then # test passed, do nothing
  exit 0
fi

mkdir -p /tmp/complement/coverlogs/$2/$1/

docker cp $1:/dendrite/integrationcover.log /tmp/complement/coverlogs/$2/$1/

This would copy /dendrite/integrationcover.log from within the container (e.g. d9c4d433e2d77f1a2572933e738f3681bce1aab1404a2ce756c8f2bb4ffffbbc) to something like /tmp/complement/coverlogs/TestContent/d9c4d433e2d77f1a2572933e738f3681bce1aab1404a2ce756c8f2bb4ffffbbc/integrationcover.log

@S7evinK S7evinK requested review from a team and kegsay as code owners December 2, 2022 10:41
@kegsay kegsay merged commit d2b13c6 into main Dec 7, 2022
@kegsay kegsay deleted the s7evink/posttestscript branch December 7, 2022 14:31
S7evinK added a commit to matrix-org/dendrite that referenced this pull request Dec 23, 2022
This adds the possibility to run Complement with coverage enabled.
In combination with matrix-org/complement#566 we
should then be able to extract the coverage logs, combine them with
https://github.com/wadey/gocovmerge (or similar) and upload them to
Codecov (with different flags, depending on SQLite, HTTP etc.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants