【发布时间】:2019-07-20 08:10:01
【问题描述】:
我在我的 Django 项目中使用 CircleCI。我想在后台运行一个服务器(特别是python manage.py runserver)以进行一些特定的硒测试。
我的config.yml有点像
version: 2
jobs:
build:
docker:
- image: circleci/python:3.6.1-browsers
- image: selenium/standalone-chrome
working_directory: ~/myproject
steps:
- checkout
- run:
name: install dependencies
command: |
python3 -m venv venv
. venv/bin/activate
pip install -r requirements.txt
- run:
name: run unit tests
command: |
. venv/bin/activate
python manage.py test
- run:
name: run selenium tests
command: |
. venv/bin/activate
python manage.py migrate
python manage.py runserver 8000
python manage.py run_selenium_tests
我可以通过在 django LiveServerTestCase 中运行 selenium 测试来使其工作。但我想独立运行 selenium 测试,因为我需要 runserver 在后台运行。现在 circleci 在python manage.py runserver 处停止执行并最终超时。有什么想法吗?
【问题讨论】:
标签: python django continuous-integration circleci