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

tmp/parallel_runtime_test.log is not generated in github actions #894

Open
yasirazgar opened this issue Mar 3, 2023 · 6 comments
Open

Comments

@yasirazgar
Copy link

tmp/parallel_runtime_test.log is not generated in github actions but it is generated in my local env,
I tried creating a temp folder, no luck.
I tried creating a file "tmp/parallel_runtime_test.log" and pushed think atleast logs will be written to that file, no luck.

This is the how I run the tests,

- name: Execute tests
      env:
        REPORT_NAME: "test/reports/${{ matrix.TEST_SUITE }}${{ matrix.GROUP_NUM[0] }}-${{ matrix.RAILS_NEXT }}/report-${TEST_ENV_NUMBER}-attempt-${{ github.run_attempt }}.xml"
        RECORD_RUNTIME: 1
      run: |
        mkdir -p "test/reports/${{ matrix.TEST_SUITE }}${{ matrix.GROUP_NUM[0] }}-${{ matrix.RAILS_NEXT }}/"
        RAILS_NEXT=${{matrix.RAILS_NEXT}} bundle exec parallel_test -o "--junit --junit-filename=$REPORT_NAME" --verbose -n ${{ matrix.GROUPS_COUNT }} --only-group ${{ join(matrix.GROUP_NUM, ',') }} test/${{ matrix.TEST_SUITE }}/
@grosser
Copy link
Owner

grosser commented Mar 6, 2023

There is no if/else code that decides to write these files on CI/local, so I'd recommend reproducing the exact command locally.
Also might want to print the env to see if anything went wrong there.
You required as documented https://github.com/grosser/parallel_tests#minitest ?
Might be an issue with junit overwriting the regular formatter ...

@yasirazgar
Copy link
Author

yasirazgar commented Apr 26, 2023

Sorry for delayed response.

I ran the exact command locally it seems to work fine.
Yes I required as per the document.

Might be an issue with junit overwriting the regular formatter.

I think that might be the case, as we have some additional reporters in local vs CI.


For fixing this I had to use load 'parallel_tests/test/runtime_logger' instead of require 'parallel_tests/test/runtime_logger'

I even tried debugging the require command it is returning true, not sure why the contents are not loaded.

puts require 'parallel_tests/test/runtime_logger'
true

@grosser
Copy link
Owner

grosser commented Apr 28, 2023

that just means it's already loaded ... try "puts ParallelTest::Test::RuntimeLogger" before the require, it should not blow up

@prem-prakash
Copy link

no log being generated here too, but with rspec

@grosser
Copy link
Owner

grosser commented Jun 3, 2024

here is an example repo where it works: https://github.com/grosser/parallel_rails_example

@grosser
Copy link
Owner

grosser commented Jun 3, 2024

maybe some kind of combination of versions or so, modify and run locally until it works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants