joonvena / Robot-Reporter

Robot Reporter is a tool for Robot Framework test reporting.
7 stars 6 forks source link

Issue with new versions of download and upload artifacts #19

Open samuelpcabral opened 2 months ago

samuelpcabral commented 2 months ago

Hello, I updated the download and upload artifact to this versions:

actions/upload-artifact@v4 actions/download-artifact@v4.1.7

but I got this error:

Status: Downloaded newer image for joonvena/robot-reporter:v2.5 2024/09/23 15:04:59 open /home/runner/work/robotframework-aws/robotframework-aws/robot_reports/output.xml: no such file or directory Error: Process completed with exit code 1.

need to update something or I need to change my code?

this is my yml:

jobs:
  run-localstack-and-robot:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout code
      uses: actions/checkout@v4
    - name: Set up Docker
      uses: docker/setup-buildx-action@v3
    - name: Install Docker Compose
      run: |
        sudo apt-get update
        sudo apt-get install docker-compose -y
    - name: Start Localstack docker
      working-directory: ./localstack
      run: |
        docker-compose up -d
    - name: Wait for LocalStack to be ready
      run: sleep 10
    - name: Set up Python 3.10
      uses: actions/setup-python@v4
      env:
        ROBOT_TESTS_DIR: ${{ github.workspace }}/Tests
        ROBOT_REPORTS_DIR: ${{ github.workspace }}/reports
      with:
        python-version: '3.10'
    - name: Install Dependencies
      working-directory: ./
      run: pip install -r requirements.txt
    - name: Run Robot Framework
      run: robot -d ./reports ./tests/robot
    - name: Upload test results
      uses: actions/upload-artifact@v4
      if: always()
      with:
        name: robot_reports
        path: reports

  generate-robot-report:
    if: always()
    needs: [ run-localstack-and-robot ]
    runs-on: ubuntu-latest
    steps:
      - name: Download reports
        uses: actions/download-artifact@v4.1.7
        with:
          name: robot_reports
      - name: Send report to commit
        uses: joonvena/robotframework-reporter-action@v2.5
        with:
          gh_access_token: ${{ secrets.GITHUB_TOKEN }}
          report_path: /robot_reports

here the full github action: https://github.com/samuelpcabral/robotframework-aws/actions/runs/10997037190/job/30531740457

joonvena commented 2 months ago

Hi, havent done any changes to report file handling in a long time. Did it work with older version of artifact actions? You could maybe also add extra step after the download artifact step to see if the file is actually there in working dir.

samuelpcabral commented 2 months ago

Hi @joonvena yes.. before with lower versions was working like this one: https://github.com/samuelpcabral/robotframework-aws/actions/runs/10511530095

One difference that I see is:

in the uploaded version 1 the files are uploaded:

Run actions/upload-artifact@v1
Uploading artifact 'robot_reports' from '/home/runner/work/robotframework-aws/robotframework-aws/reports' for run #11
Uploading 4 files
File upload complete.
Uploaded '619337' bytes from '/home/runner/work/robotframework-aws/robotframework-aws/reports' to server
Associated artifact robot_reports (18[12](https://github.com/samuelpcabral/robotframework-aws/actions/runs/10511530095/job/29122711507#step:10:13)5133) with run #11

but in the upload v4 is zipped and uploaded:

Run actions/upload-artifact@v4
With the provided path, there will be 4 files uploaded
Artifact name is valid!
Root directory input is valid!
Beginning upload of artifact content to blob storage
Uploaded bytes 179817
Finished uploading artifact content to blob storage!
SHA256 hash of uploaded artifact zip is 0289393fc0a36fc08108c487dbdb3ebb5f[16](https://github.com/samuelpcabral/robotframework-aws/actions/runs/10997037190/job/30531624859#step:10:17)bf6f2791b65f8e9bb0ccfb6ab8fb
Finalizing artifact upload
Artifact robot_reports.zip successfully finalized. Artifact ID 1966864940
Artifact robot_reports has been successfully uploaded! Final size is [17](https://github.com/samuelpcabral/robotframework-aws/actions/runs/10997037190/job/30531624859#step:10:18)9817 bytes. Artifact ID is 1966864940
Artifact download URL: https://github.com/samuelpcabral/robotframework-aws/actions/runs/10997037[19](https://github.com/samuelpcabral/robotframework-aws/actions/runs/10997037190/job/30531624859#step:10:20)0/artifacts/1966864940

Maybe the issue could be there...

joonvena commented 2 months ago

I would suggest adding the extra step for debugging purposes that would list the files in working dir to check if there is zip file there or folder with the output.xml.