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

terratest_log_parser does not retain a lot of useful test and failure information #1399

Open
dkirrane opened this issue Mar 26, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@dkirrane
Copy link

dkirrane commented Mar 26, 2024

Describe the bug
I would expect the report.xml generated by terratest_log_parser to contain the reason for the test failure.
However, terratest_log_parser loses the assertion results

To Reproduce

  1. go test -count=1 -v | tee test_output.log

The above command created the following lines in the test_output.log:

--- FAIL: TestHelloWorldTerraform (0.74s)
    terraform_hello_world_test.go:193: 
        	Error Trace:	/mnt/c/terratest/terraform_hello_world_test.go:193
        	Error:      	Not equal: 
        	            	expected: "Hello foo eRcjAe"
        	            	actual  : "Hello eRcjAe"
        	            	
        	            	Diff:
        	            	--- Expected
        	            	+++ Actual
        	            	@@ -1 +1 @@
        	            	-Hello foo eRcjAe
        	            	+Hello eRcjAe
        	Test:       	TestHelloWorldTerraform
FAIL
exit status 1
  1. terratest_log_parser -testlog test_output.log -outputdir test_output --log-level info

The above command created the following report.xml:

<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
	<testsuite tests="1" failures="1" time="0.804" name="github.com/company/terratest">
		<properties>
			<property name="go.version" value="go1.11"></property>
		</properties>
		<testcase classname="terratest" name="Failure" time="0.000">
			<failure message="Failed" type="">    terraform_hello_world_test.go:193: </failure>
		</testcase>
	</testsuite>
</testsuites>

Expected behavior
I would expect the report.xml to include

  • the testcase name == test i.e. the go test function name TestHelloWorldTerraform
  • the failure body == assertion error

Versions

  • Terratest version: 1.7.5
  • Environment details (Ubuntu 20.04, Windows 10, etc.): WSL2
@dkirrane dkirrane added the bug Something isn't working label Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant