0

I am using a CI tool called Drone(drone.io). So i really want to do some integration tests with it. What i want is Drone to start my application container on some port on the drone host and then I would be able to run integration tests against it. For example in .drone.yml file:

build:
  image: python3.5-uwsgi
  pull: true
  auth_config:
      username: some_user
      password: some_password
      email: email
  commands:
      - pip install --user --no-cache-dir -r requirements.txt
      - python manage.py integration_test -h 127.0.0.1:5000 
# this should send various requests to 127.0.0.1:5000
# to test my application's behaviour 

compose:
   my_application:
     # build and run a container based on dockerfile in local repo on port 5000


publish:

deploy:
GeneralFailure
  • 1,085
  • 3
  • 16
  • 32

1 Answers1

2

Drone 0.4 can't start service from your Dockerfile, if you want start docker container, you should build it before, outside this build, and push to dockerhub or your own registry and put this in compose section, see http://readme.drone.io/usage/services/#images:bfc9941b6b6fd7b4ef09dd0ccd08af0c

You can also start your application in build, nohup python manage.py server -h 127.0.0.1:5000 & before you running your integration tests. Make sure that your application is started and listening 5000 port, before you run integration_test.

I recommend you use drone 0.5 with pipelines, you can build docker image and push that to registry before build, and use that as service inside your build.

bugagazavr
  • 46
  • 1