#25 clean up the fedmsg config file to make tox happy
Closed 3 years ago by mjia. Opened 3 years ago by mjia.
mjia/waiverdb fix_tox  into  master

file modified
+2
@@ -9,3 +9,5 @@ 

  test_env

  .cache

  docs/_build

+ /.coverage

+ /.tox/

file modified
+11 -12
@@ -13,7 +13,6 @@ 

  # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the

  # GNU General Public License for more details.

  

- import os

  import socket

  

  hostname = socket.gethostname()
@@ -28,14 +27,14 @@ 

      high_water_mark=0,

      io_threads=1,

  

-     ## For the fedmsg-hub and fedmsg-relay. ##

+     # For the fedmsg-hub and fedmsg-relay. #

  

      # This is a status dir to keep a record of the last processed message

-     #status_directory=os.getcwd() + "/status",

-     #status_directory='/var/run/fedmsg/status',

+     # status_directory=os.getcwd() + "/status",

I don't agree with flake8 on this one, and indeed I often find flake8 complains about things that are quite legitimate... I would be in favour of taking it out, maybe replacing with a fairly conservative configuration of pylint like we have for Beaker.

+     # status_directory='/var/run/fedmsg/status',

  

      # This is the URL of a datagrepper instance that we can query for backlog.

-     #datagrepper_url="https://apps.fedoraproject.org/datagrepper/raw",

+     # datagrepper_url="https://apps.fedoraproject.org/datagrepper/raw",

  

      # We almost always want the fedmsg-hub to be sending messages with zmq as

      # opposed to amqp or stomp.  You can send with only *one* of the messaging
@@ -46,12 +45,12 @@ 

  

      # On the other hand, if you wanted to use STOMP *instead* of zeromq, you

      # could do the following...

-     #zmq_enabled=False,

-     #stomp_uri='localhost:59597,localhost:59598',

-     #stomp_user='username',

-     #stomp_pass='password',

-     #stomp_ssl_crt='/path/to/an/optional.crt',

-     #stomp_ssl_key='/path/to/an/optional.key',

+     # zmq_enabled=False,

+     # stomp_uri='localhost:59597,localhost:59598',

+     # stomp_user='username',

+     # stomp_pass='password',

+     # stomp_ssl_crt='/path/to/an/optional.crt',

+     # stomp_ssl_key='/path/to/an/optional.key',

  

      # When subscribing to messages, we want to allow splats ('*') so we tell

      # the hub to not be strict when comparing messages topics to subscription
@@ -119,7 +118,7 @@ 

      certnames={

          # In prod/stg, map hostname to the name of the cert in ssldir.

          # Unfortunately, we can't use socket.getfqdn()

-         #"app01.stg": "app01.stg.phx2.fedoraproject.org",

+         # "app01.stg": "app01.stg.phx2.fedoraproject.org",

      },

  

      # A mapping of fully qualified topics to a list of cert names for which

file modified
+1
@@ -9,6 +9,7 @@ 

  kerberos >= 1.1.1

  

  pytest >= 2.4.2

+ coverage

  mock

  

  # Documentation requirements

file modified
+10 -2
@@ -1,5 +1,5 @@ 

  [tox]

- envlist = lint,py27,py34,py35,py36,docs

+ envlist = lint,py27,py34,py35,py36,docs,coverage

  # If the user is missing an interpreter, don't fail

  skip_missing_interpreters = True

  
@@ -24,6 +24,14 @@ 

      rm -rf _build/

      sphinx-build -W -b html -d {envtmpdir}/doctrees .  _build/html

  

+ [testenv:coverage]

+ deps =

+     -rrequirements.txt

+ commands =

+     coverage run --parallel-mode -m pytest

+     coverage combine

+     coverage report --omit=.tox/* -m --skip-covered

+ 

  [testenv:lint]

  deps =

      flake8 > 3.0
@@ -33,4 +41,4 @@ 

  [flake8]

  show-source = True

  max-line-length = 100

- exclude = .git,.tox,dist,*egg

+ exclude = .git,.tox,dist,*egg,env_waiverdb

no initial comment

@ralph , somehow fedmsg is not installed in the Py35 enviroment when running tox. Do you know
why?

By default tox caches its installs inside a .tox directory. There is a directive (recreate = true I believe) which will cause it to rebuild all the venvs each run, but it adds a bit of time to each test run. I just rm -rf .tox when I add a new dependency.

By default tox caches its installs inside a .tox directory. There is a directive (recreate = true I believe) which will cause it to rebuild all the venvs each run, but it adds a bit of time to each test run. I just rm -rf .tox when I add a new dependency.

Thanks, work like a charm, :-)

1 new commit added

  • tox: add coverage environment
3 years ago

I don't agree with flake8 on this one, and indeed I often find flake8 complains about things that are quite legitimate... I would be in favour of taking it out, maybe replacing with a fairly conservative configuration of pylint like we have for Beaker.

Pull-Request has been closed by mjia

3 years ago