GithubHelp home page GithubHelp logo

Proper test suite about odd-jobs HOT 6 OPEN

saurabhnanda avatar saurabhnanda commented on June 5, 2024
Proper test suite

from odd-jobs.

Comments (6)

mrputty avatar mrputty commented on June 5, 2024

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)?

from odd-jobs.

saurabhnanda avatar saurabhnanda commented on June 5, 2024

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.

from odd-jobs.

saurabhnanda avatar saurabhnanda commented on June 5, 2024

@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.

from odd-jobs.

saurabhnanda avatar saurabhnanda commented on June 5, 2024

@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.

from odd-jobs.

mrputty avatar mrputty commented on June 5, 2024

@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.

from odd-jobs.

mrputty avatar mrputty commented on June 5, 2024

@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.

from odd-jobs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.