-
Notifications
You must be signed in to change notification settings - Fork 367
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
JUnit output missing filename #1406
Comments
See #1409 which fixes the misses filename in the failure message (a bug) |
For reference: https://eslint.org/docs/user-guide/formatters/#junit ESLint considers each file its own |
Hi @bendrucker, I saw #1409 has been merged and I've just downloaded the latest TFlint version: $ tflint -v
TFLint version 0.37.0 I can now see "type" but it's empty (can't remember if it was always like this) and no filename is within the failure message? <?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite tests="1" failures="1" time="0" name="">
<properties></properties>
<testcase classname="\terraform\modules\tf_resource_group\resource\main.tf" name="terraform_required_providers" time="0">
<failure message="Missing version constraint for provider "azurerm" in "required_providers"" type="">line 1, col 1, Warning - Missing version constraint for provider "azurerm" in "required_providers" (terraform_required_providers)</failure>
</testcase>
</testsuite>
</testsuites> Any recommendations in which I havent taken into account? Unsure what your release process is I.e next version will include this :) Thanks |
Not released yet |
You're a star for this - appreciate the help! |
Hi @bendrucker, I can see the new update and it's working as expected. I just had a question if an additional feature can be implemented on top of this. It's great I know which file TFLint is talking about, but for my projects and possible other users, I scan every terraform directory within my codebase to be linted. Each of these directories pretty much have the same files I.e backend.tf + Main.tf etc Would it be possible to get the literal path of the file so instead of "backend.tf" it becomes "/made/up/path/backend.tf" or even just it's parent dir so I know where i am I.e "/project1/backend.tf" Let me know if this would be useful and if not I can find a solution that works for my specific use case 😁 |
No, absolute paths are not an option. Nor is the parent directory. Please reserve issues for a specific proposal and avoid reopening them for use as an ongoing support thread. |
Using Azure DevOps to publish test results in the format of JUNIT using this command to generate output:
I then Publish this task using:
All of the above works and publishes the tests with no issues.
The issue comes from the XML it generates where the classname is the path in which has been scanned - the issue with this is that the Publish Test Task uses this:
This causes the test title to be the error message and not the file path or a combination - I suppose I would like an amended
failure message to include the path it has scanned:
line 54, col 1, FIle [Path] Notice - `data_vnet` variable has no description (terraform_documented_variables)
I know I'm a small use case for this, I was hoping if anyone would have any advice or if this can be updated?
The text was updated successfully, but these errors were encountered: