-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
I want to generate a html report for terratest scripts. Like how many tests are Pass/Fail? If it is possible can you tell me how to do it? #939
Comments
terratest_log_parser generates a junit xml report which many CI systems will automatically render for you. If you don't have anything handy, you can use something like https://gitlab.com/inorton/junit2html |
Any hints on how to write our test case(s) file(s) to get more useful junit reports? I only get something like this <?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite tests="1" failures="0" time="309.730" name="command-line-arguments">
<properties>
<property name="go.version" value="go1.13"></property>
</properties>
<testcase classname="command-line-arguments" name="TestAws" time="309.560"></testcase>
</testsuite>
</testsuites> Right now I have one source file for the test cases, and it defines one function like func TestAws(t *testing.T) {
terraformOptions := &terraform.Options{
TerraformDir: "..",
Vars: map[string]interface{}{
...
},
}
defer terraform.Destroy(t, terraformOptions)
terraform.InitAndApply(t, terraformOptions)
aws.AssertS3BucketExists(t, awsRegion, "expected_bucket_name")
dynamoTable := aws.GetDynamoDBTable(t, awsRegion, "expected_table_name")
assert.NotNil(t, dynamoTable)
} I can infer that each |
Hello, We are adding terratest UnitTests for our Terraform code as-well, however the JUNIT report is reporting 0 testsuite cases, even though when running locally we have multiple reports. The information isn't very useful, is there a work around? I have multiple
|
I hit the same issue as @jkrusic, my issue was not using the verbose flag on the test command:
when it needed to be:
Not sure if it's a bug as I'm new to Terratest, or if the docs just need an update (https://terratest.gruntwork.io/docs/testing-best-practices/debugging-interleaved-test-output/), but the first option doesn't include the markings (like below) that get used by the log_parser:
|
Thank you, that fixed my issues. Now getting what I expected. Appreciate the comment. |
No description provided.
The text was updated successfully, but these errors were encountered: