'How to generate test report into file

I am currently running few terratests. On console I can see the log when add -v option but How do I generate test report of pass/failed tests? maybe in html or pdf format



Solution 1:[1]

go test -timeout 30m | tee test_output.log terratest_log_parser -testlog test_output.log -outputdir test_output

This will:

  • Create a file TEST_NAME.log for each test it finds from the test output containing the logs corresponding to that test.

  • Create avsummary.log file containing the test result lines for each test.

  • Create a report.xml file containing a Junit XML file of the test summary (so it can be integrated in your CI).

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dinesh