English 中文(简体)
4. 露天环境中的露天安乐团融合试验
原标题:Run Python integration tests inside pBuilder environment

I have build a Debian package out of a Python project which depends on a bunch of Debian packages to work. The Python project also contains unit and integration tests (using py.test).

由于我的项目取决于一些德比亚一揽子计划,我需要在测试环境中安装这些包裹,并且他们应当核实我的模块与这些包裹正确合作(我希望确保我的模块不会中断对这些校准的更新)。

我想把这些试验环境的配置和实施工作纳入一个文件。 这些测试应在开发商工作站和Jenkins-赋权一体化服务器上进行。

我目前对我的一揽子计划进行全面整合测试的方法是:

  1. Create a pBuilder environment
  2. Install dependencies from Debian-controlfile into pBuilder env
  3. Inside this pBuilder-environment launch py.test, also using virtualenv / tox to test different Python interpreter versions
  4. collect test-results from test environment (py.test can generate nice JUnit-like test output which Jenkins can publish easily)

不幸的是,我找不到任何东西来说明如何消除这一障碍,特别是如何做到这一点。 我可以发现的所有文件都只是关于建立一揽子计划,而不是进行试验。

谁能给我提供我如何建立这种试验? 此外,我想知道,做我所要做的事情是否有意义。 如何测试将(Python)单元与其他Debian一揽子计划结合起来?

最佳回答

我假定,你想在建造包装时进行试验。

(1) 在您的整套文件表上添加一个<代码>check的具体目标,该工具包括所有虚拟/tox magic,例如:

.PHONY: check
check:
    ./runtests.sh

附有<代码>runtests.sh的文字,可进行口译检查,然后开页。 测试

(2) 没收您的<代码>debian/rules,以实际操作测试

2a) 如果您使用CDBS,则在您的bian/统治开始时增加以下一线。

DEB_MAKE_CHECK_TARGET = check

b) 如果您使用debhelper,则dh_auto_test 文字应当自动操作对你的测试(条件是is<>em> a check)。 页: 1

2c) 如果您有一套惯例debian/rules,则在成功建造后实现“check”目标。

问题回答

How do others test integration of (Python) modules with other Debian packages?

一种选择是,在虚拟机器或廉价的云服务器上,提供全新的系统,以操作你的测试。

如果你死在屋顶上,你可以援引带有<条码>pbuilderlement<>/条码>的任意文字。

可在





相关问题
Can Django models use MySQL functions?

Is there a way to force Django models to pass a field to a MySQL function every time the model data is read or loaded? To clarify what I mean in SQL, I want the Django model to produce something like ...

An enterprise scheduler for python (like quartz)

I am looking for an enterprise tasks scheduler for python, like quartz is for Java. Requirements: Persistent: if the process restarts or the machine restarts, then all the jobs must stay there and ...

How to remove unique, then duplicate dictionaries in a list?

Given the following list that contains some duplicate and some unique dictionaries, what is the best method to remove unique dictionaries first, then reduce the duplicate dictionaries to single ...

What is suggested seed value to use with random.seed()?

Simple enough question: I m using python random module to generate random integers. I want to know what is the suggested value to use with the random.seed() function? Currently I am letting this ...

How can I make the PyDev editor selectively ignore errors?

I m using PyDev under Eclipse to write some Jython code. I ve got numerous instances where I need to do something like this: import com.work.project.component.client.Interface.ISubInterface as ...

How do I profile `paster serve` s startup time?

Python s paster serve app.ini is taking longer than I would like to be ready for the first request. I know how to profile requests with middleware, but how do I profile the initialization time? I ...

Pragmatically adding give-aways/freebies to an online store

Our business currently has an online store and recently we ve been offering free specials to our customers. Right now, we simply display the special and give the buyer a notice stating we will add the ...

Converting Dictionary to List? [duplicate]

I m trying to convert a Python dictionary into a Python list, in order to perform some calculations. #My dictionary dict = {} dict[ Capital ]="London" dict[ Food ]="Fish&Chips" dict[ 2012 ]="...