oldmoe / litestack

MIT License
1.13k stars 62 forks source link

How do I run the test suite for this project? #63

Closed westonganger closed 5 months ago

westonganger commented 1 year ago

I dont seem to be able to run the test suite for this project.

Would like to be able to just type bundle exec rake test and have the test suite just work. However I cant help out with that until I get some info for steps here.

Can you please provide some instructions on how to run the test suite?

oldmoe commented 12 months ago

I just pushed a cleanup to the test directory, running

rake test

Should run all the tests

Please note that the first error you get means you are running an older version of sqlite3, please install a newer version if possible (yes, the error message needs to be improved)

oldmoe commented 12 months ago

SQLite 3.43 is the required version

westonganger commented 12 months ago

@oldmoe seems better. But we also need to add sequel to the gemspec as a development dependency

westonganger commented 12 months ago

@oldmoe should all the tests be passing so far?

If we have existing failing specs than it would be good to mark them as skipped/pending until they are updated to be passing. If we have them skipped, then we can slowly work on fixing these while maintaining a green build.

gshaw commented 12 months ago

@westonganger you aren't alone.

I also had to add sequel as a development dependency to get the test suite to run rake test.

I'm only getting failed tests in test_jobqueue. At this point I'm not exactly sure why the tests are failing but I'm pretty sure it's a timing problem as the tests have a number of hard coded sleep calls. If nothing else those sleeps are the cause of the stalled tests. When I re-run the test suite I get different failing tests though always 3 and always only in test_jobqueue. Sometimes the test suite doesn't complete and hangs though and I have to CTRL+C to exit.

When I test just that specific file using rake test TEST=test/test_jobqueue.rb I get zero or one failing test which makes me more convinced it's a timing related issue.

I thought I'd share my findings here while I continue to dig deeper in case other people are having similar problems.

I'm running the tests on a M1 Mac mini with Ruby 3.2.2.

oldmoe commented 11 months ago

I will fix the sequel dependency, sadly, the current implementation for litejob* is flaky, it passes at times and fails at others. I need to implement better time management in litequeue and the tests to fix that, hopefully will get to that soon.

As for the schema error in test_ar_search, this could be due to the way AR loads the dependencies, something I have been struggling to fix, but a workaround would be to remove the existing gem and install one from the local gemspec,