[PATCH v2 1/3] travis: test against postgresql 10 and 11

Daniel Axtens dja at axtens.net
Fri Aug 10 01:12:28 AEST 2018


Hi Daniel,

> +matrix:
> +  include:
> +    - addons:
> +        postgresql: "10"
> +        apt:
> +          packages:
> +          - postgresql-10
> +          - postgresql-client-10
> +      env:
> +        - PGPORT=5433
> +        - PW_TEST_DB_PORT=5433
> +        - PW_TEST_DB_TYPE=postgres
> +        - PW_TEST_DB_USER=travis
> +        - PW_TEST_DB_PASS=""


The password is redundant here as it's also supplied in the global: var
list.

It's not documented in the commit message, but if I understand
correctly, the reason you need to specify PGPORT and PW_TEST_DB_PORT is
because the postgres server runs _in addition to_ the original 9.6
server on 5432. So the new server picks 5433 and we need to tell psql
(PGPORT) and patchwork (PW_TEST_DB_PORT) about it.

If you end up doing a respin of this series for patch 2, please change
these things. If we end up keeping patch 2 as is or dropping it
entirely, I'll just make these changes when I merge.

> +      python: 3.6
> +      sudo: true
> +      before_install:
> +        - sudo -u postgres psql -c "grant ALL on DATABASE postgres to travis WITH GRANT OPTION;"
> +    - env:
> +        - PGPORT=5433
> +        - PW_TEST_DB_PORT=5433
> +        - PW_TEST_DB_TYPE=postgres
> +        - PW_TEST_DB_USER=travis
> +        - PW_TEST_DB_PASS=""
> +      python: 3.6
> +      dist: trusty
> +      addons:
> +        postgresql: "11"
> +        apt:
> +          sources:
> +          - sourceline: 'deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg 11'
> +            key_url: 'https://www.postgresql.org/media/keys/ACCC4CF8.asc'
> +          packages:
> +          - postgresql-11
> +          - postgresql-client-11
> +      sudo: true
> +      before_install:
> +        - sudo -u postgres psql -c "grant ALL on DATABASE postgres to travis WITH GRANT OPTION;"
> +
> +
>  before_script:
> -  - mysql -e 'create database patchwork character set utf8;'
> -  - psql -c "create database patchwork with ENCODING = 'UTF8';" -U postgres
> +  - if [[ $PW_TEST_DB_TYPE == mysql ]]; then mysql -e 'create database patchwork character set utf8;'; fi
> +  - if [[ $PW_TEST_DB_TYPE == postgres ]]; then psql -c "create database patchwork with ENCODING = 'UTF8';" -U $PW_TEST_DB_USER; fi

Thanks for cleaning this up.

>  script:
> +  - >
> +    if [[ $PW_TEST_DB_TYPE == mysql ]];
> +    then
> +      mysql -e 'SELECT VERSION(), CURRENT_USER();' -u $PW_TEST_DB_USER patchwork;
> +    else
> +      psql -c "SELECT VERSION(), CURRENT_USER, current_database()" -U $PW_TEST_DB_USER patchwork;
> +    fi

I really like this bit, thanks!

>    - tox
>    - tox -e coverage
>  
> -- 
> 2.17.1
>
> _______________________________________________
> Patchwork mailing list
> Patchwork at lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/patchwork


More information about the Patchwork mailing list