Skip to content

RFC: feat(docker/dev): Add support for Docker-based dev testing and forensics#194

Closed
hughsw wants to merge 2 commits intobee-queue:masterfrom
hughsw:docker-based-dev-support
Closed

RFC: feat(docker/dev): Add support for Docker-based dev testing and forensics#194
hughsw wants to merge 2 commits intobee-queue:masterfrom
hughsw:docker-based-dev-support

Conversation

@hughsw
Copy link
Copy Markdown
Collaborator

@hughsw hughsw commented Mar 28, 2020

Adds support for using Docker to test bee-queue.

$ ./run-docker-script.sh --help

run-docker-script.sh -- Run a default test script or commands of your choice in a Docker
container with the bee-queue library and a Redis server.

Usage: run-docker-script.sh [command ...args]

The optional command argument is an executable or or a script to run in the
container.  The default command is docker-scripts/default-docker-script.sh which
runs tests, the linter, and test coverage.

You can run Node JS tools and scripts, e.g.

  run-docker-script.sh  npx ava --fail-fast --verbose

If you want to work interactively in the container, use bash, e.g.

  run-docker-script.sh  bash

Scripts must be in the ./docker-scripts directory.  E.g. your custom testing
script ./docker-scripts/my-testing.sh would be run via

  run-docker-script.sh  docker-scripts/my-testing.sh

Notes:
- The very first time this script is used it takes a while for Docker to
  populate its caches.
- You can ignore the Transparent Huge Pages warning from the Redis server.

@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 100.0% when pulling 2375d3b on hughsw:docker-based-dev-support into 6f1d62f on bee-queue:master.

1 similar comment
@coveralls
Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 100.0% when pulling 2375d3b on hughsw:docker-based-dev-support into 6f1d62f on bee-queue:master.

@coveralls
Copy link
Copy Markdown

coveralls commented Mar 28, 2020

Coverage Status

Coverage remained the same at 100.0% when pulling 93e05f3 on hughsw:docker-based-dev-support into 6f1d62f on bee-queue:master.

@hughsw
Copy link
Copy Markdown
Collaborator Author

hughsw commented Mar 28, 2020

I have observed intermittent test failures from delay-test.js when using this with Docker for Mac.
E.g.

  128 passed
  1 failed

  delay-test › Delayed jobs should process a distant delayed job
  /bee-queue/test/delay-test.js:202

   201:     mockTimer.emit('trigger');         
   202:     t.is(await scheduled, start + 150);
   203:                                        

  Difference:

  - -1
  + 1585414307075

Or this:

  128 passed
  1 failed

  delay-test › Delayed jobs should process a distant delayed job
  /bee-queue/test/delay-test.js:196

   195:     await queue.createJob({is: 'distant'}).delayUntil(start + 150).save();
   196:     t.is(mockTimer.schedule.secondCall.args[0], start + 150);             
   197:     await scheduled;                                                      

  Rejected promise returned by test. Reason:

  TypeError {
    message: 'Cannot read property \'args\' of null',
  }

@hughsw
Copy link
Copy Markdown
Collaborator Author

hughsw commented Apr 1, 2020

I have a much better docker framework which I will publish later this week once some travel is behind me. I'm closing this to avoid folks waisting time on it.

@hughsw hughsw closed this Apr 1, 2020
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

Successfully merging this pull request may close these issues.

2 participants