【问题标题】:Integration testing with drone.io使用drone.io 进行集成测试
【发布时间】:2016-09-12 12:40:58
【问题描述】:

我正在使用一个名为 Drone(drone.io) 的 CI 工具。所以我真的很想用它做一些集成测试。我想要的是 Drone 在无人机主机上的某个端口上启动我的应用程序容器,然后我就可以针对它运行集成测试。例如在 .drone.yml 文件中:

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:

【问题讨论】:

    标签: continuous-integration drone.io


    【解决方案1】:

    Drone 0.4 无法从您的Dockerfile 启动服务,如果您想启动 docker 容器,您应该在此构建之前构建它,然后推送到 dockerhub 或您自己的注册表并将其放入 compose 部分,请参阅@ 987654321@

    在运行集成测试之前,您还可以在 nohup python manage.py server -h 127.0.0.1:5000 & 中启动您的应用程序。在运行 integration_test 之前,请确保您的应用程序已启动并侦听 5000 端口。

    我建议您使用具有管道的无人机 0.5,您可以构建 docker 映像并在构建之前将其推送到注册表,并将其用作构建中的服务。

    【讨论】:

      猜你喜欢
      • 2013-04-07
      • 2019-12-17
      • 2015-12-28
      • 2020-05-26
      • 2018-01-02
      • 2021-02-03
      • 2015-06-14
      • 2018-12-23
      • 2013-01-17
      相关资源
      最近更新 更多