-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Switch to using pytest-django to run the Django tests, as that has JUnit support. Add Django settings as a flag rather than in pyproject.toml because defining it there makes the normal pytest run fail since it can't find the module. - Adds a simple script using junitparser to combine the two JUnit XML files.
- Loading branch information
1 parent
f262199
commit 79f78f0
Showing
4 changed files
with
48 additions
and
5 deletions.
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
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 |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import sys | ||
|
||
from junitparser import JUnitXml | ||
|
||
|
||
def combine_junit_xml(output_file, *input_files): | ||
combined_xml = JUnitXml() | ||
for input_file in input_files: | ||
xml = JUnitXml.fromfile(input_file) | ||
combined_xml.extend(xml) | ||
combined_xml.write(output_file) | ||
|
||
|
||
if __name__ == "__main__": | ||
if len(sys.argv) < 3: | ||
print( | ||
"Usage: python combine_junit_xml.py <output_file> <input_file1> <input_file2> ... <input_fileN>" | ||
) | ||
sys.exit(1) | ||
|
||
output_file = sys.argv[1] | ||
input_files = sys.argv[2:] | ||
combine_junit_xml(output_file, *input_files) |
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