<i id='uILEl'><tr id='uILEl'><dt id='uILEl'><q id='uILEl'><span id='uILEl'><b id='uILEl'><form id='uILEl'><ins id='uILEl'></ins><ul id='uILEl'></ul><sub id='uILEl'></sub></form><legend id='uILEl'></legend><bdo id='uILEl'><pre id='uILEl'><center id='uILEl'></center></pre></bdo></b><th id='uILEl'></th></span></q></dt></tr></i><div id='uILEl'><tfoot id='uILEl'></tfoot><dl id='uILEl'><fieldset id='uILEl'></fieldset></dl></div>

        <bdo id='uILEl'></bdo><ul id='uILEl'></ul>

      <small id='uILEl'></small><noframes id='uILEl'>

      <legend id='uILEl'><style id='uILEl'><dir id='uILEl'><q id='uILEl'></q></dir></style></legend>

      1. <tfoot id='uILEl'></tfoot>

        TeamCity for Python/Django 持续集成

        时间:2023-08-06
          • <bdo id='rKld1'></bdo><ul id='rKld1'></ul>

            <small id='rKld1'></small><noframes id='rKld1'>

          • <i id='rKld1'><tr id='rKld1'><dt id='rKld1'><q id='rKld1'><span id='rKld1'><b id='rKld1'><form id='rKld1'><ins id='rKld1'></ins><ul id='rKld1'></ul><sub id='rKld1'></sub></form><legend id='rKld1'></legend><bdo id='rKld1'><pre id='rKld1'><center id='rKld1'></center></pre></bdo></b><th id='rKld1'></th></span></q></dt></tr></i><div id='rKld1'><tfoot id='rKld1'></tfoot><dl id='rKld1'><fieldset id='rKld1'></fieldset></dl></div>

                    <tbody id='rKld1'></tbody>
                • <legend id='rKld1'><style id='rKld1'><dir id='rKld1'><q id='rKld1'></q></dir></style></legend>

                  <tfoot id='rKld1'></tfoot>
                  本文介绍了TeamCity for Python/Django 持续集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  我在 Linux (Ubuntu) 机器上设置了 TeamCity 并希望使用它适用于一些 Python/Django 项目.

                  I've set up TeamCity on a Linux (Ubuntu) box and would like to use it for some of Python/Django projects.

                  问题是我真的不知道下一步该做什么 - 我尝试为 TeamCity 搜索特定于 Python 的构建代理,但没有取得多大成功.

                  The problem is that I don't really see what to do next - I tried searching for a Python specific build agent for TeamCity but without much of the success.

                  我该如何管理?

                  推荐答案

                  好的,下面是如何让它与适当的 TeamCity 集成一起工作:

                  Ok, so there's how to get it working with proper TeamCity integration:

                  假设您安装了 TeamCity,并且至少有 1 个可用的构建代理

                  Presuming you have TeamCity installed with at least 1 build agent available

                  1) 配置你的构建代理来执行

                  1) Configure your build agent to execute

                  manage.py test
                  

                  2) 为 TC 下载并安装此插件 http://pypi.python.org/pypi/teamcity-消息

                  2) Download and install this plugin for TC http://pypi.python.org/pypi/teamcity-messages

                  3) 您必须为 (2) 中的插件提供自定义测试运行器才能工作.它可以是来自 django.test.simple 的 run_tests 的直接副本,只需稍作修改:将调用测试运行器的行替换为 TeamcityTestRunner,因此插入

                  3) You'll have to provide your custom test runner for plugin in (2) to work. It can be straight copy of run_tests from django.test.simple, with only one slight modification: replace line where test runner is called with TeamcityTestRunner, so insted of

                  def run_tests(test_labels, verbosity=1, interactive=True, extra_tests=[]):
                      ...
                      result = unittest.TextTestRunner(verbosity=verbosity).run(suite)
                  

                  使用这个:

                  def run_tests(test_labels, verbosity=1, interactive=True, extra_tests=[]):
                      ...
                      result = TeamcityTestRunner().run(suite)
                  

                  您必须将该函数放入解决方案中的文件中,并使用 Django 的 TEST_RUNNER 配置属性指定自定义测试运行器,如下所示:

                  You'll have to place that function into a file in your solution, and specify a custome test runner, using Django's TEST_RUNNER configuration property like this:

                  TEST_RUNNER = 'my_site.file_name_with_run_tests.run_tests'
                  

                  确保在 file_name_with_run_tests

                  你可以通过运行来测试它

                  You can test it by running

                  ./manage.py test
                  

                  从命令行并注意到输出发生了变化,现在出现了类似的消息

                  from command line and noticing that output has changed and now messages like

                  #teamcity....
                  

                  出现在里面.

                  这篇关于TeamCity for Python/Django 持续集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:如何确保 README.rst 有效? 下一篇:“漂亮"Python 的持续集成

                  相关文章

                  最新文章

                    <legend id='HHW93'><style id='HHW93'><dir id='HHW93'><q id='HHW93'></q></dir></style></legend>

                    1. <small id='HHW93'></small><noframes id='HHW93'>

                        <bdo id='HHW93'></bdo><ul id='HHW93'></ul>

                      <i id='HHW93'><tr id='HHW93'><dt id='HHW93'><q id='HHW93'><span id='HHW93'><b id='HHW93'><form id='HHW93'><ins id='HHW93'></ins><ul id='HHW93'></ul><sub id='HHW93'></sub></form><legend id='HHW93'></legend><bdo id='HHW93'><pre id='HHW93'><center id='HHW93'></center></pre></bdo></b><th id='HHW93'></th></span></q></dt></tr></i><div id='HHW93'><tfoot id='HHW93'></tfoot><dl id='HHW93'><fieldset id='HHW93'></fieldset></dl></div>
                      <tfoot id='HHW93'></tfoot>