如何在Travis-CI中使用Vagrant启动Virtualbox VM ?
我知道有时不支持在VM中启动VM,但是已经报告了使用此特定配置的成功.
我正在尝试设置一个持续集成服务器来运行我的sysadmin工具的单元测试,以便在不同的操作系统和Python版本中进行测试.它使用Tox处理初始化各种Python虚拟环境和Pytest来运行测试并包装Vagrant来设置和拆除Virtualbox VM.它在我的Ubuntu 14 localhost上正常运行,但在Travis中,Vagrant超时尝试启动Virtualbox VM:
==> default: Importing base box 'ubuntu/trusty64'...
==> default: Matching MAC address for NAT networking...
==> default: Checking if box 'ubuntu/trusty64' is up to date...
==> default: Setting the name of the VM: functional_tests_default_1463515960654_71459
==> default: Clearing any previously set forwarded ports...
==> default: Clearing any previously set network interfaces...
==> default: Preparing network interfaces based on configuration...
default: Adapter …Run Code Online (Sandbox Code Playgroud) 创建从我的网站到运行 CherryPy 的 Python 服务器的发布请求时,我收到错误Access to XMLHttpRequest has been blocked by CORS policy: Request header field content-type is not allowed by Access-Control-Allow-Headers in preflight response.. 我可以使用“CORS Everywhere”浏览器扩展程序之一暂时解决问题,但是
这是相关的代码:
从网站发布请求调用的 CherryPy Python 函数
@cherrypy.expose
@cherrypy.tools.json_in()
def add_meeting(self):
data = None
id = None
start_time = None
end_time = None
title = None
userlist = None
result = {"operation": "request", "result": "success"}
if cherrypy.request.method == "POST":
data = cherrypy.request.json
id = data["id"]
start_time = data["start_time"]
end_time …Run Code Online (Sandbox Code Playgroud)