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

Proper test suite #4

Open
saurabhnanda opened this issue Apr 23, 2020 · 6 comments
Open

Proper test suite #4

saurabhnanda opened this issue Apr 23, 2020 · 6 comments
Labels

Comments

@saurabhnanda
Copy link
Owner

No description provided.

@mrputty
Copy link
Contributor

mrputty commented Oct 13, 2020

As a prelude to working on issue #38, I just tried to build the current test-suite (via cabal configure --enable-tests; cabal build tests), and it fails with lots of errors like this:

test/Test.hs:163:38: error:
    Not in scope: ‘Job.monitorJobRunner’
    Module ‘OddJobs.Job’ does not export ‘monitorJobRunner’.
    |
163 |   let jobMonitorSettings = defaults{ Job.monitorJobRunner = jobRunner
    |                                      ^^^^^^^^^^^^^^^^^^^^

It looks like these undefined symbols are from an earlier version of odd-jobs. Is the jobrunner test-suite intended to work with the current version?

There are several other code files in this test-suite that are empty or all commented out. Also, the devel executable seems to have been used for ad hoc testing as some point, but it is also no longer working.

@saurabhnanda, could you describe the current testing process (prior to the implementation of a proper test suite)?

@saurabhnanda
Copy link
Owner Author

could you describe the current testing process (prior to the implementation of a proper test suite)?

there were simple "example based" tests primarily to ensure that the underlying raw SQL for things like createJob, scheduleJob were working.

There was one massive property-based test which first scheduled many randomly created jobs, and then run them, and then assert a bunch of properties.

I'll get the test suite back to working condition and then we can collaborate on it iteratively along with developing the feature and the benchmarks.

@saurabhnanda
Copy link
Owner Author

@mrputty I've got the tests to compile again in the fix/tests branch. Although the tests themselves are still failing. I'll spend some time now in getting the tests up-to-speed.

@saurabhnanda
Copy link
Owner Author

@mrputty the "example based" tests are passing now. The property-based test is still commented-out. I'll take a look at it over the weekend.

@mrputty
Copy link
Contributor

mrputty commented Oct 18, 2020

@saurabhnanda , thanks for looking at this. I've started thinking about how to write some behavioral tests for #38, but I'd like to get your comments on my draft #55 before I put any real work into that.

@mrputty
Copy link
Contributor

mrputty commented Oct 19, 2020

@saurabhnanda, I'm soon going to start working on unit test for #38. I normally do Haskell development in Docker containers, and I typically run things like a database for unit testing in a separate container from the one running GHC. The upshot of this is that I'd like to make a change in the test/Test.sh to facilitate this.

Specifically, I'd like to introduce an environment variable that would, if set, override the hard coded connInfo that's currently defined in main. I'd also do a little bit of refactoring around pool creation, but otherwise I don't think anything would have to change, and things would continue to work as they do today when the environment variable is not set.

Let me know if you have any concerns about this.

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

No branches or pull requests

2 participants