view .travis.yml @ 5548:fea11d05110e

Avoid errors from selecting "no selection" on multilink (issue2550722). As discussed in issue 2550722 there are various cases where selecting "no selection" on a multilink can result in inappropriate errors from Roundup: * If selecting "no selection" produces a null edit (a value was set in the multilink in an edit with an error, then removed again, along with all other changes, in the next form submission), so the page is rendered from the form contents including the "-<id>" value for "no selection" for the multilink. * If creating an item with a nonempty value for a multilink has an error, and the resubmission changes that multilink to "no selection" (and this in turn has subcases, according to whether the creation then succeeds or fails on the resubmission, which need fixes in different places in the Roundup code). All of these cases have in common that it is expected and OK to have a "-<id>" value for a submission for a multilink when <id> is not set in that multilink in the database (because the original attempt to set <id> in that multilink had an error), so the hyperdb.py logic to give an error in that case is thus removed. In the subcase of the second case where the resubmission with "no selection" has an error, the templating code tries to produce a menu entry for the "-<id>" multilink value, which also results in an error, hence the templating.py change to ignore such values in the list for a multilink.
author Joseph Myers <jsm@polyomino.org.uk>
date Thu, 27 Sep 2018 11:33:01 +0000
parents ff5e3e7d216c
children a82c56a9c2a2
line wrap: on
line source

language: python
python:
  - 2.7
  - 3.4
  - 3.5
  - 3.6

sudo: false

addons:
  apt:
    sources:
      - sourceline: ppa:xapian-backports/ppa

    packages:
      # Required to build/install the xapian-binding
      - libxapian-dev
      # Required to install gpg
      - swig
      # Required to build gpgme.
      - gpgsm

before_install:
  # Sphinx required to build the xapian python bindings
  - pip install sphinx
  - XAPIAN_VER=$(dpkg -l libxapian-dev | tail -n 1 | awk '{print $3}' | cut -d '-' -f 1)
  - cd /tmp
  - curl -s -O https://oligarchy.co.uk/xapian/$XAPIAN_VER/xapian-bindings-$XAPIAN_VER.tar.xz
  - tar -Jxvf xapian-bindings-$XAPIAN_VER.tar.xz
  - cd xapian-bindings-$XAPIAN_VER/
  - if [[ $TRAVIS_PYTHON_VERSION == "2."* ]]; then ./configure --prefix=$VIRTUAL_ENV --with-python; fi
  - if [[ $TRAVIS_PYTHON_VERSION == "3."* ]]; then ./configure --prefix=$VIRTUAL_ENV --with-python3; fi
  - make && make install

  - PATH=$VIRTUAL_ENV/bin:$PATH

  # libgpg-error
  - LIBGPG_ERROR_VERSION=1.32
  - cd /tmp
  - curl -s -O https://www.gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-$LIBGPG_ERROR_VERSION.tar.bz2
  - tar -jxvf libgpg-error-$LIBGPG_ERROR_VERSION.tar.bz2
  - cd libgpg-error-$LIBGPG_ERROR_VERSION
  - ./configure --prefix=$VIRTUAL_ENV
  - make && make install

  # libassuan
  - LIBASSUAN_VERSION=2.5.1
  - cd /tmp
  - curl -s -O https://www.gnupg.org/ftp/gcrypt/libassuan/libassuan-$LIBASSUAN_VERSION.tar.bz2
  - tar -jxvf libassuan-$LIBASSUAN_VERSION.tar.bz2
  - cd libassuan-$LIBASSUAN_VERSION
  - ./configure --prefix=$VIRTUAL_ENV
  - make && make install

  # gpgme
  - GPGME_VERSION=1.11.1
  - cd /tmp
  - curl -s -O https://www.gnupg.org/ftp/gcrypt/gpgme/gpgme-$GPGME_VERSION.tar.bz2
  - tar -jxvf gpgme-$GPGME_VERSION.tar.bz2
  - cd gpgme-$GPGME_VERSION
  - ./configure --prefix=$VIRTUAL_ENV
  - make && make install

  # change back to the checked out repository directory
  - cd $TRAVIS_BUILD_DIR

install:
  - pip install gpg mysqlclient psycopg2 pytz whoosh
  - pip install pytest-cov codecov

before_script:
  # set up mysql database
  - mysql -u root -e 'GRANT ALL ON rounduptest.* TO rounduptest@localhost IDENTIFIED BY "rounduptest";'

  # set up postgresql database
  - psql -c "CREATE ROLE rounduptest WITH CREATEDB LOGIN PASSWORD 'rounduptest';" -U postgres

  # HACK: workaround mysql bug: http://bugs.mysql.com/bug.php?id=74901
  #   needed for test_mysql.mysqlDBTest.testFilteringSpecialChars
  - sed -i 's/CREATE DATABASE \%s/CREATE DATABASE \%s COLLATE utf8_general_ci/' roundup/backends/back_mysql.py

script:
  - PATH=$VIRTUAL_ENV/bin:$PATH
  - export LD_LIBRARY_PATH=$VIRTUAL_ENV/lib:$LD_LIBRARY_PATH
  - py.test -v test/ --cov=roundup

after_success:
  - codecov

Roundup Issue Tracker: http://roundup-tracker.org/