maester365 / maester

The core repository for the Maester module with helper cmdlets that will be called from the Pester tests.
https://maester.dev
MIT License
289 stars 70 forks source link

No artifact recieved after update 0.3.0 #427

Open Haakonak opened 2 weeks ago

Haakonak commented 2 weeks ago

Hello Maester community! I have a question/problem with artifacts. After updating to the latest version 0.3.0 i no longer recieve an artifact after running Maester as an action.

I am using the given Maester as an Action script, with the modification of adding "mail_userid" and "mail_recipient".

jobs:
  run-maester-tests:
    name: Run Maester Tests
    runs-on: ubuntu-latest
    steps:
    - name: Run Maester action
      uses: maester365/maester@main
      with:
        client_id: ${{ secrets.AZURE_CLIENT_ID }}
        tenant_id: ${{ secrets.AZURE_TENANT_ID }}
        include_public_tests: false # Optional 
        pester_verbosity: 'None' # Optional - 'None', 'Normal', 'Detailed', 'Diagnostic'
        mail_userid: 'example.userid'
        mail_recipients: 'example.user@mail.com'

From the run logs, the parameter "artifact_upload" returns "true", but when looking through the summary there is no artifact. I have attempted adding the "artifact_upload" parameter and manually setting it to "true" without any results. I have also tried to remove "mail_userid" and "mail_recipients" but still no artifact.

If anyone has any tips or info that could explain this issue to me i would be very grateful. If this does not qualify as an issue, i can post it in the Discussions forum instead.

merill commented 2 weeks ago

Do you see the .html file being created?

Haakonak commented 2 weeks ago

I compared my latest Maester run with a previous one which did produce an artifact, and the "actions/upload-artifact@v4" is skipped completely. However, right before displaying how many tests were run, passed and failed, it does seem like the .html is being created.

🔥 Maester test report generated at test-results/test-results.html

Tests Passed ✅: 74, Failed ❌: 39, Skipped ⚫: 22

Script execution Complete
merill commented 2 weeks ago

@f-bader Could this be an issue with Github Action not uploading the artifact?

f-bader commented 2 weeks ago

Will check if there is a fail or something that prevents this. Should not happen

albert-widjaja commented 5 days ago

I also could not find the Artifact tab despite running it successfully.

image

f-bader commented 5 days ago

Could this be related to https://github.com/actions/upload-artifact/releases/tag/v4.4.0

We will no longer include hidden files and folders by default in the upload-artifact action of this version. This reduces the risk that credentials are accidentally uploaded into artifacts. Customers who need to continue to upload these files can use a new option, include-hidden-files, to continue to do so.

Haakonak commented 3 days ago

This does seem like it could be whats causing this issue.

I am not well versed in testing and contributing to open source projects, but i assume an edited version of the "action.yml" file that looks like following could fix the issue.

- name: Archive Maester Html Report
      uses: actions/upload-artifact@v4
      if: ${{ inputs.artifact_upload == true }}
      with:
        name: maester-test-results-${{ env.NOW }}
        path: test-results
        include-hidden-files: true # Upload artifact to action summary

I have also had troubles with getting the mail_recipients parameter to work aswell, i think this might also be caused by the artifact not being uploaded as a default.