-
Notifications
You must be signed in to change notification settings - Fork 16
Testing
There are over 1300 tests available to run against rethinkdb-job-queue
. Due to the reliance on the RethinkDB
database, they are integration tests rather than unit tests.
If you have docker-compose installed, first run the following command to launch RethinkDB:
docker-compose up
If you installed RethinkDB on your laptop, make sure the service is running.
Once RethinkDB is running simply do the following from a command line:
git clone https://github.com/grantcarthew/node-rethinkdb-job-queue
cd node-rethinkdb-job-queue
npm install
npm test
// or for verbose output
npm run tv
Note that some of the tests are time sensitive and I have seen the odd error in the tests if the order of events does not occur perfectly.
If you do not have RethinkDB
installed locally or you want to change the names of the database, please edit the test-options.js file to your liking. The top of the file looks like the following:
const dbHost = module.exports.dbHost = 'localhost'
const dbPort = module.exports.dbPort = 28015
const dbName = module.exports.dbName = 'rjqJobQueueTests'
const queueName = module.exports.queueName = 'rjqJobQueueTestJobs'
If you wish to run a tests for a single module use the example command below from within the rethinkdb-job-queue
directory. This will make your testing a lot faster.
# Minimal output
> ./node_modules/.bin/tap ./tests/queue-process.spec.js
# Verbose output with extended test timeout
> ./node_modules/.bin/tap ./tests/queue-process.spec.js --timeout 10000 --reporter tap
Have you read the Debugging document yet?
The integration tests for rethinkdb-job-queue
will leave a database on your RethinkDB
server. Please connect to the RethinkDB web interface and delete the database.
- Introduction
- Tutorial
- Queue Constructor
- Queue Connection
- Queue Options
- Queue PubSub
- Queue Master
- Queue Events
- State Document
- Job Processing
- Job Options
- Job Status
- Job Retry
- Job Repeat
- Job Logging
- Job Editing
- Job Schema
- Job Name
- Complex Job
- Delayed Job
- Cancel Job
- Error Handling
- Queue.createJob
- Queue.addJob
- Queue.getJob
- Queue.findJob
- Queue.findJobByName
- Queue.containsJobByName
- Queue.cancelJob
- Queue.reanimateJob
- Queue.removeJob
- Queue.process
- Queue.review
- Queue.summary
- Queue.ready
- Queue.pause
- Queue.resume
- Queue.reset
- Queue.stop
- Queue.drop
- Queue.Job
- Queue.host
- Queue.port
- Queue.db
- Queue.name
- Queue.r
- Queue.id
- Queue.jobOptions [R/W]
- Queue.changeFeed
- Queue.master
- Queue.masterInterval
- Queue.removeFinishedJobs
- Queue.running
- Queue.concurrency [R/W]
- Queue.paused
- Queue.idle
- Event.ready
- Event.added
- Event.updated
- Event.active
- Event.processing
- Event.progress
- Event.log
- Event.pausing
- Event.paused
- Event.resumed
- Event.completed
- Event.cancelled
- Event.failed
- Event.terminated
- Event.reanimated
- Event.removed
- Event.idle
- Event.reset
- Event.error
- Event.reviewed
- Event.detached
- Event.stopping
- Event.stopped
- Event.dropped
- Job.setName
- Job.setPriority
- Job.setTimeout
- Job.setDateEnable
- Job.setRetryMax
- Job.setRetryDelay
- Job.setRepeat
- Job.setRepeatDelay
- Job.updateProgress
- Job.update
- Job.getCleanCopy
- Job.addLog
- Job.getLastLog