How to configue Pydev test runner to use Docker

I am developing a Django app or two using pydev as my IDE. I like it a lot 🙂 However, I recently got really excited about Docker and am using Docker and Fig to serve my application now. My problem is that I would like to run my tests in this build environment- seems like this is kinda the point after all!

I know how to actually do it.

  • How to change timezone of postgreSQL 9.5 on docker?
  • Graceful Shutdown of HDFS with Docker
  • amazon ecs Container for Configuration files
  • Docker mysql mounted logs directory always empty
  • System.InvalidOperationException: Unable to resolve project 'HelloMvc6' from /ap p/src/HelloMvc6
  • Mounted lvm volume not passed to container
  • fig run web python3 /code/manage.py test
    

    would run the tests. If I didn’t want to use the Django runner, I could run

    fig run web python3 /code/myapp/tests.py
    

    Either way though, I cannot figure out how to issue that command from the IDE. All of the run configurations point to the configured python.exe … does anyone know if there is a way to replace that with a fully customized command?

  • Identifying files contained within a docker image (or Application dependencies)
  • Docker: multiple sites with common containers
  • Kitematic - Force using Virtualbox
  • No docker-quickstart found on mac
  • Permission denied when changing docker image folder
  • Validating docker v0.8 on OS X, boot2docker ssh hangs, docker version generates EOF
  • One Solution collect form web for “How to configue Pydev test runner to use Docker”

    Well, the PyDev launch configuration is really targeted towards running Python, but there are alternatives to running it through other ways:

    1. Create an external tool run (run > external tools > external tools configuration): You should be able to run anything you want from there… the downside is that this isn’t really integrated into PyDev, so, if you have stack-traces they won’t be clickable (and you won’t be able to debug either).

    2. Create a launcher script which in turn uses subprocess to launch the command you want… if you redirect things tracebacks should be clickable. The downside is that you won’t be able to create a debug session either — but you can still use the remote debugging in this case (http://pydev.org/manual_adv_remote_debugger.html)

    3. Improve PyDev to do that better… (i.e.: get the code: http://pydev.org/developers.html and add docker support to a project through fig — it should be something close to org.python.pydev.django which has special integration for running in django — with some tweaks to the start command line, even starting in debug mode directly can work here)… if you decide to go that route, you can create a feature request at https://sw-brainwy.rhcloud.com/tracker/PyDev/ and ask code-related stuff and I’ll help 🙂

    4. Possibly you can create a custom executable which acts like Python but in reality just forwards things to other places (i.e.: to fig run) — I haven’t actually tested this, but in theory it should work (in the past there was work to support dummy ‘python’ runners such as that — i.e.: for supporting http://cctbx.sourceforge.net/ — so, it should work — but you still have to create this launcher script for your use case to pass things to fig run). If the work is done properly, the debugger could work here too.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.