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

Issue when tests finish #102

Open
huda-kh opened this issue Dec 11, 2024 · 2 comments
Open

Issue when tests finish #102

huda-kh opened this issue Dec 11, 2024 · 2 comments

Comments

@huda-kh
Copy link

huda-kh commented Dec 11, 2024

I have set up flatware in my rails app with the flatware_helper settings quoted in the README. I run the tests in Gitlab CI using: bundle exec flatware fan rake db:test:prepare RAILS_ENV=test. The tests succeed and coverage is printed at the end successfully, but sometimes the pending tests are then printed again, and the coverage is not calculated causing the CI job to fail.

�[32;1m$ bundle exec flatware fan rake db:test:prepare RAILS_ENV=test�[0;m
Running 'rake db:test:prepare RAILS_ENV=test' on 8 workers
�[32;1m$ bundle exec flatware rspec -r ./spec/flatware_helper�[0;m
[....]
Pending: (Failures listed here are expected and do not affect your suite's status)
[...]
Finished in 4 minutes 20.2 seconds (files took 15.77 seconds to load)
3281 examples, 0 failures, 17 pending
Coverage report generated for RSpec, RSpec (subprocess: 0), RSpec (subprocess: 1), RSpec (subprocess: 2), RSpec (subprocess: 3), RSpec (subprocess: 4), RSpec (subprocess: 5), RSpec (subprocess: 6), RSpec (subprocess: 7) to /builds/app/app/coverage/results.csv
Coverage is 67.80%, 0.80% above the minimum

Pending: (Failures listed here are expected and do not affect your suite's status)

[...]

Finished in 4 minutes 20.2 seconds (files took 15.77 seconds to load)
3281 examples, 0 failures, 17 pending
done.
section_end:1733893682:step_script
�[0Ksection_start:1733893682:archive_cache_on_failure
�[0K�[0K�[36;1mSaving cache for failed job�[0;m�[0;m
�[32;1mCreating cache gems-15-non_protected...�[0;m
vendor/bundle/: found 22915 matching artifact files and directories�[0;m 
No URL provided, cache will not be uploaded to shared cache server. Cache will be stored only locally.�[0;m 
�[32;1mCreated cache�[0;m
section_end:1733893691:archive_cache_on_failure
�[0Ksection_start:1733893691:upload_artifacts_on_failure
�[0K�[0K�[36;1mUploading artifacts for failed job�[0;m�[0;m
�[32;1mUploading artifacts...�[0;m
coverage: found 251 matching artifact files and directories�[0;m 
�[0;33mWARNING: tmp/screenshots: no matching files. Ensure that the artifact path is relative to the working directory (/builds/app/app)�[0;m 
�[0;33mWARNING: tmp/capybara: no matching files. Ensure that the artifact path is relative to the working directory (/builds/app/app)�[0;m 
examples.txt: found 1 matching artifact files and directories�[0;m 
Uploading artifacts as "archive" to coordinator... 201 Created�[0;m  id�[0;m=67437 responseStatus�[0;m=201 Created token�[0;m=glcbt-64
section_end:1733893692:upload_artifacts_on_failure
�[0Ksection_start:1733893692:cleanup_file_variables
�[0K�[0K�[36;1mCleaning up project directory and file based variables�[0;m�[0;m
section_end:1733893693:cleanup_file_variables
�[0K�[31;1mERROR: Job failed: exit code 1
�[0;m

Any ideas why this might be happening? The coverage is also different in every run and is higher (by 8%!!) when ran on my machine! Let me know if you need any more details.

@huda-kh
Copy link
Author

huda-kh commented Dec 11, 2024

Ah, found that SimpleCov was being started twice in two different files ('spec_helper.rbandsupport/coverage.rb`). I'll see if deleting one fixes it!

@huda-kh
Copy link
Author

huda-kh commented Dec 11, 2024

Ah, found that SimpleCov was being started twice in two different files ('spec_helper.rbandsupport/coverage.rb`). I'll see if deleting one fixes it!

Not it.. still doing the same on Gitlab.

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

1 participant