From 8b38027ba2b91ef7fbe59a35a5332d17f0beadb0 Mon Sep 17 00:00:00 2001 From: "David E. Wheeler" Date: Sun, 14 Nov 2021 17:45:35 -0500 Subject: [PATCH] Add test coverage workflow. Add a new script, `.github/ubuntu/all-apt-prereqs.sh`, to install all apt packages at once, and teach each of the engine scripts not to install apt packages when `SKIP_DEPENDS` is set. Also have the Postgres an SQLite scripts fall back on a default version to install if one is not passed. Remove the old `prereqs.sh`. And have the SQLite script install SQLite into `/opt/sqlite` to be more like the other engine installers, and have it and the Oracle script properly share the `LD_LIBRARY_PATH` variable. The new workflow, `.github/workflows/coverage.yml`, sets up all of the services and clients, as well as modules for reporting coverage to Coveralls, and runs the tests. Now that it uses a script installed in `local/bin`, teach all the workflows to cache all of `local`, not just `local/lib`. Get Oracle 21 tests working, too. Thanks to @gvenzl's help in gvenzl/oci-oracle-xe#45. Remove `.travis.yml` and references to it. Travis testing has not worked for a while, and is no more. Have `prove` run tests in parallel in 4 processes where it runs multiple tests, so that builds finish more quickly. Add build and release badges to README.md, and move most links to the bottom of the text for better plain text legibility. Most of the GitHub badges don't handle the Emoji correctly, but hopefully that will be addressed before long. Finally, add a call to `disconnect` to `t/oracle.t` to prevent a segfault that Devel::Cover seems to induce in DBD::Oracle (see perl5-dbi/DBD-Oracle#111). --- .github/ubuntu/all-apt-prereqs.sh | 11 ++ .github/ubuntu/exasol.sh | 8 +- .github/ubuntu/firebird.sh | 11 +- .github/ubuntu/mysql.sh | 7 +- .github/ubuntu/oracle.sh | 12 +- .github/ubuntu/pg.sh | 7 +- .github/ubuntu/prereqs.sh | 7 - .github/ubuntu/snowflake.sh | 8 +- .github/ubuntu/sqlite.sh | 22 ++- .github/ubuntu/vertica.sh | 8 +- .github/workflows/coverage.yml | 102 ++++++++++++ .github/workflows/exasol.yml | 2 +- .github/workflows/firebird.yml | 4 +- .github/workflows/mysql.yml | 2 +- .github/workflows/oracle.yml | 8 +- .github/workflows/os.yml | 4 +- .github/workflows/perl.yml | 4 +- .github/workflows/pg.yml | 2 +- .github/workflows/snowflake.yml | 2 +- .github/workflows/sqlite.yml | 2 +- .github/workflows/vertica.yml | 2 +- .travis.yml | 247 ------------------------------ MANIFEST.SKIP | 1 - README.md | 142 +++++++++++------ t/firebird.t | 2 +- t/lib/DBIEngineTest.pm | 2 +- t/oracle.t | 17 ++ 27 files changed, 286 insertions(+), 360 deletions(-) create mode 100755 .github/ubuntu/all-apt-prereqs.sh delete mode 100755 .github/ubuntu/prereqs.sh create mode 100644 .github/workflows/coverage.yml delete mode 100644 .travis.yml diff --git a/.github/ubuntu/all-apt-prereqs.sh b/.github/ubuntu/all-apt-prereqs.sh new file mode 100755 index 000000000..cc6b253fd --- /dev/null +++ b/.github/ubuntu/all-apt-prereqs.sh @@ -0,0 +1,11 @@ +set -e + +sudo apt-get update -qq +sudo env DEBIAN_FRONTEND=noninteractive apt-get install -qq \ + libicu-dev gettext aspell-en software-properties-common \ + curl unixodbc-dev odbcinst unixodbc \ + default-jre \ + firebird-dev firebird3.0-utils \ + mysql-client default-libmysqlclient-dev \ + libarchive-tools +cat t/odbc/odbcinst.ini | sudo tee -a /etc/odbcinst.ini diff --git a/.github/ubuntu/exasol.sh b/.github/ubuntu/exasol.sh index c04f6aaf1..b7a858078 100755 --- a/.github/ubuntu/exasol.sh +++ b/.github/ubuntu/exasol.sh @@ -6,12 +6,14 @@ version=${1:-7} echo $version # Download dependencies. -sudo apt-get update -qq -sudo env DEBIAN_FRONTEND=noninteractive apt-get install -qq curl unixodbc-dev odbcinst unixodbc default-jre +if [ -z "$SKIP_DEPENDS" ]; then + sudo apt-get update -qq + sudo env DEBIAN_FRONTEND=noninteractive apt-get install -qq curl unixodbc-dev odbcinst unixodbc default-jre + cat t/odbc/odbcinst.ini | sudo tee -a /etc/odbcinst.ini +fi # Prepare the configuration. mkdir -p /opt/exasol -cat t/odbc/odbcinst.ini | sudo tee -a /etc/odbcinst.ini # Download and unpack Exasol ODBC Driver & EXAplus. if [[ "$version" =~ ^6 ]]; then diff --git a/.github/ubuntu/firebird.sh b/.github/ubuntu/firebird.sh index 8de39e413..90a968f2b 100755 --- a/.github/ubuntu/firebird.sh +++ b/.github/ubuntu/firebird.sh @@ -3,5 +3,12 @@ set -e # Download dependencies. -sudo apt-get update -qq -sudo env DEBIAN_FRONTEND=noninteractive apt-get install -qq firebird-dev firebird3.0-utils +if [ -z "$SKIP_DEPENDS" ]; then + sudo apt-get update -qq + sudo env DEBIAN_FRONTEND=noninteractive apt-get install -qq firebird-dev firebird3.0-utils +fi + +# Tell DBD::Firebird where to find the libraries. +if [[ ! -z "$GITHUB_ENV" ]]; then + echo "FIREBIRD_HOME=/usr" >> $GITHUB_ENV +fi diff --git a/.github/ubuntu/mysql.sh b/.github/ubuntu/mysql.sh index be8ecbf09..5e378554a 100755 --- a/.github/ubuntu/mysql.sh +++ b/.github/ubuntu/mysql.sh @@ -3,6 +3,7 @@ set -e # Download dependencies. -sudo apt-get update -qq -sudo env DEBIAN_FRONTEND=noninteractive apt-get install -qq mysql-client default-libmysqlclient-dev - +if [ -z "$SKIP_DEPENDS" ]; then + sudo apt-get update -qq + sudo env DEBIAN_FRONTEND=noninteractive apt-get install -qq mysql-client default-libmysqlclient-dev +fi diff --git a/.github/ubuntu/oracle.sh b/.github/ubuntu/oracle.sh index fab76a7e0..2a0e695ee 100755 --- a/.github/ubuntu/oracle.sh +++ b/.github/ubuntu/oracle.sh @@ -6,8 +6,10 @@ version=21.3.0.0.0 icdr=213000 # Install bsdtar, required to get --strip-components for a zip file. -sudo apt-get update -qq -sudo apt-get install -qq libarchive-tools +if [ -z "$SKIP_DEPENDS" ]; then + sudo apt-get update -qq + sudo env DEBIAN_FRONTEND=noninteractive apt-get install -qq libarchive-tools +fi # Download Instant Client. # https://www.oracle.com/database/technologies/instant-client/downloads.html @@ -28,5 +30,9 @@ fi if [[ ! -z "$GITHUB_ENV" ]]; then echo "ORACLE_HOME=/opt/instantclient" >> $GITHUB_ENV - echo "LD_LIBRARY_PATH=/opt/instantclient" >> $GITHUB_ENV + if [[ -z "$LD_LIBRARY_PATH" ]]; then + echo "LD_LIBRARY_PATH=/opt/instantclient" >> $GITHUB_ENV + else + echo "LD_LIBRARY_PATH=/opt/instantclient:$LD_LIBRARY_PATH" >> $GITHUB_ENV + fi fi diff --git a/.github/ubuntu/pg.sh b/.github/ubuntu/pg.sh index 9568f3a8a..ed59ce843 100755 --- a/.github/ubuntu/pg.sh +++ b/.github/ubuntu/pg.sh @@ -2,12 +2,7 @@ set -e -PGVERSION=${PGVERSION:=$1} -if [[ -z "$PGVERSION" ]]; then - echo "Usage: $0 \$version" - exit 32 -fi - +PGVERSION=${PGVERSION:=${1:-14}} [[ $PGVERSION =~ ^[0-9]$ ]] && PGVERSION+=.0 curl -O https://salsa.debian.org/postgresql/postgresql-common/-/raw/master/pgdg/apt.postgresql.org.sh diff --git a/.github/ubuntu/prereqs.sh b/.github/ubuntu/prereqs.sh deleted file mode 100755 index 9220661b5..000000000 --- a/.github/ubuntu/prereqs.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -set -e - -sudo apt-get update -qq -sudo apt-get install -qq libicu-dev gettext aspell-en software-properties-common -cat t/odbc/odbcinst.ini | sudo tee -a /etc/odbcinst.ini diff --git a/.github/ubuntu/snowflake.sh b/.github/ubuntu/snowflake.sh index 3134425f5..a56e9f3eb 100755 --- a/.github/ubuntu/snowflake.sh +++ b/.github/ubuntu/snowflake.sh @@ -3,8 +3,11 @@ set -e # Set up Snowflake. -sudo apt-get update -qq -sudo apt-get install -qq unixodbc-dev odbcinst unixodbc +if [ -z "$SKIP_DEPENDS" ]; then + sudo apt-get update -qq + sudo env DEBIAN_FRONTEND=noninteractive apt-get install -qq unixodbc-dev odbcinst unixodbc + cat t/odbc/odbcinst.ini | sudo tee -a /etc/odbcinst.ini +fi # https://docs.snowflake.net/manuals/release-notes/client-change-log-snowsql.html # https://sfc-repo.snowflakecomputing.com/index.html @@ -13,7 +16,6 @@ curl -sSLo snowdbc.tgz https://sfc-repo.snowflakecomputing.com/odbc/linux/2.24.2 # Install and configure ODBC. mkdir -p /opt/snowflake -cat t/odbc/odbcinst.ini | sudo tee -a /etc/odbcinst.ini sudo tar --strip-components 1 -C /opt/snowflake -xzf snowdbc.tgz sudo mv /opt/snowflake/ErrorMessages/en-US /opt/snowflake/lib/ diff --git a/.github/ubuntu/sqlite.sh b/.github/ubuntu/sqlite.sh index 4692051e6..a0e07e508 100755 --- a/.github/ubuntu/sqlite.sh +++ b/.github/ubuntu/sqlite.sh @@ -2,13 +2,7 @@ set -e -DIR=$(pwd) - -SQLITE=${SQLITE:=$1} -if [[ -z "$SQLITE" ]]; then - echo "Usage: $0 \$version" - exit 32 -fi +SQLITE=${SQLITE:=${1:-3.36.0}} # Convert to the SQLITE_VERSION_NUMBER format https://sqlite.org/c3ref/c_source_id.html SQLITE=$(perl -e 'my @v = split /[.]/, shift; printf "%d%02d%02d%02d\n", @v[0..3]' $SQLITE) @@ -33,8 +27,8 @@ fi # Download, compile, and install SQLite. curl -o sqlite.zip https://sqlite.org/$YEAR/sqlite-amalgamation-$SQLITE.zip -unzip -j sqlite.zip -d sqlite -cd sqlite +unzip -j sqlite.zip -d /opt/sqlite +cd /opt/sqlite # Build the CLI. gcc shell.c sqlite3.c -lpthread -ldl -o sqlite3 # Build the shared library @@ -47,13 +41,17 @@ URL=https://cpan.metacpan.org/authors/id/${DIST:0:1}/${DIST:0:2}/$DIST curl -o dbd.tar.gz $URL tar zxvf dbd.tar.gz --strip-components 1 perl -i -pe 's/^if\s*\(\s*0\s*\)\s\{/if (1) {/' Makefile.PL -perl Makefile.PL SQLITE_INC=$DIR/sqlite SQLITE_LIB=$DIR/sqlite +perl Makefile.PL SQLITE_INC=/opt/sqlite SQLITE_LIB=/opt/sqlite make && make install if [[ ! -z "$GITHUB_PATH" ]]; then - echo "$DIR/sqlite" >> $GITHUB_PATH + echo "/opt/sqlite" >> $GITHUB_PATH fi if [[ ! -z "$GITHUB_ENV" ]]; then - echo "LD_LIBRARY_PATH=$DIR/sqlite" >> $GITHUB_ENV + if [[ -z "$LD_LIBRARY_PATH" ]]; then + echo "LD_LIBRARY_PATH=/opt/sqlite" >> $GITHUB_ENV + else + echo "LD_LIBRARY_PATH=/opt/sqlite:$LD_LIBRARY_PATH" >> $GITHUB_ENV + fi fi diff --git a/.github/ubuntu/vertica.sh b/.github/ubuntu/vertica.sh index 07a7c5dca..43a88ca19 100755 --- a/.github/ubuntu/vertica.sh +++ b/.github/ubuntu/vertica.sh @@ -2,10 +2,12 @@ set -e -sudo apt-get update -qq -sudo apt-get install -qq unixodbc-dev odbcinst unixodbc +if [ -z "$SKIP_DEPENDS" ]; then + sudo apt-get update -qq + sudo env DEBIAN_FRONTEND=noninteractive apt-get install -qq unixodbc-dev odbcinst unixodbc + cat t/odbc/odbcinst.ini | sudo tee -a /etc/odbcinst.ini +fi -cat t/odbc/odbcinst.ini | sudo tee -a /etc/odbcinst.ini cat t/odbc/vertica.ini | sudo tee -a /etc/vertica.ini # https://www.vertica.com/download/vertica/client-drivers/ diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 000000000..4643779ba --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,102 @@ +# This workflow creates the services and installs the clients in order to run +# coverage tests. Each engine must be accessible for a complete coverage report. +# It runs for pushes and pull requests on the main and develop branches. +name: ๐Ÿ“ˆ Coverage +on: + push: + branches: [main, develop] + pull_request: + branches: [main, develop] +jobs: + Snowflake: + name: ๐Ÿ“ˆ Coverage + runs-on: ubuntu-latest + services: + exasol: + image: exasol/docker-db:latest + ports: [ 8563 ] + options: --privileged + firebird: + image: jacobalberty/firebird:latest + ports: [ 3050 ] + env: + ISC_PASSWORD: nix + FIREBIRD_DATABASE: sqitchtest.db + mysql: + image: mysql:latest + env: { MYSQL_ALLOW_EMPTY_PASSWORD: yes } + ports: [ 3306 ] + options: --health-cmd="mysqladmin ping" --health-interval=5s --health-timeout=2s --health-retries=3 + oracle: + image: gvenzl/oracle-xe:latest + ports: [ 1521 ] + env: + ORACLE_PASSWORD: oracle + APP_USER: sqitchtest + APP_USER_PASSWORD: sqitchtest + options: >- + --health-cmd healthcheck.sh + --health-interval 20s + --health-timeout 10s + --health-retries 10 + vertica: + image: vertica/vertica-ce:latest + ports: [ 5433 ] + steps: + - uses: actions/checkout@v2 + - name: Setup Clients + env: + SKIP_DEPENDS: true + run: | + .github/ubuntu/all-apt-prereqs.sh + .github/ubuntu/exasol.sh + .github/ubuntu/firebird.sh + .github/ubuntu/mysql.sh + .github/ubuntu/oracle.sh + .github/ubuntu/pg.sh + .github/ubuntu/snowflake.sh + .github/ubuntu/vertica.sh + - name: Setup Perl + id: perl + uses: shogo82148/actions-setup-perl@v1 + with: { perl-version: latest } + - name: Cache CPAN Modules + uses: actions/cache@v2 + with: + path: local + key: perl-${{ steps.perl.outputs.perl-hash }} + - name: Download cpanfile + uses: carlosperate/download-file-action@v1.0.3 + with: + file-url: https://fastapi.metacpan.org/source/DWHEELER/App-Sqitch-v1.1.0/dist/cpanfile + - run: cpm install --verbose --show-build-log-on-failure --no-test --with-recommends --cpanfile cpanfile + - run: cpm install --verbose --show-build-log-on-failure --no-test --with-recommends DBI DBD::ODBC DBD::Firebird DBD::Oracle DBD::mysql DBD::Pg Devel::Cover Devel::Cover::Report::Coveralls Algorithm::Backoff::Exponential + - name: Install SQLite + env: { PERL5LIB: "${{ github.workspace }}/local/lib/perl5" } + run: .github/ubuntu/sqlite.sh + - name: Run Tests + env: + PERL5LIB: "${{ github.workspace }}/local/lib/perl5" + HARNESS_PERL_SWITCHES: -MDevel::Cover=-ignore,^(?:x?t|inc|bin|local)/ + LIVE_EXASOL_REQUIRED: true + SQITCH_TEST_EXASOL_URI: db:exasol://sys:exasol@127.0.0.1:${{ job.services.exasol.ports[8563] }}/?Driver=Exasol;SSLCertificate=SSL_VERIFY_NONE + LIVE_FIREBIRD_REQUIRED: true + SQITCH_TEST_FIREBIRD_URI: db:firebird://sysdba:nix@127.0.0.1:${{ job.services.firebird.ports[3050] }}//firebird/data/sqitchtest.db + LIVE_MYSQL_REQUIRED: true + SQITCH_TEST_MYSQL_URI: "db:mysql://root@127.0.0.1:${{ job.services.mysql.ports[3306] }}/information_schema" + LIVE_ORACLE_REQUIRED: true + SQITCH_TEST_ALT_ORACLE_REGISTRY: dbsnmp + SQITCH_TEST_ORACLE_URI: db:oracle://system:oracle@127.0.0.1:${{ job.services.oracle.ports[1521] }}/XE + LIVE_PG_REQUIRED: true + SQITCH_TEST_PG_URI: db:pg://postgres@/postgres + LIVE_SNOWFLAKE_REQUIRED: true + SQITCH_TEST_SNOWFLAKE_URI: db:snowflake://${{ secrets.SNOWFLAKE_USERNAME }}:${{ secrets.SNOWFLAKE_PASSWORD }}@sra81677.us-east-1/sqitchtest?Driver=Snowflake;warehouse=compute_wh + LIVE_SQLITE_REQUIRED: true + LIVE_VERTICA_REQUIRED: true + SQITCH_TEST_VSQL_URI: db:vertica://dbadmin@localhost:${{ job.services.vertica.ports[5433] }}/VMart?Driver=Vertica + run: prove -lrj4 t + - name: Report Coverage + env: + PERL5LIB: "${{ github.workspace }}/local/lib/perl5" + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: local/bin/cover -report coveralls diff --git a/.github/workflows/exasol.yml b/.github/workflows/exasol.yml index c9fda19f0..0afd2f23e 100644 --- a/.github/workflows/exasol.yml +++ b/.github/workflows/exasol.yml @@ -35,7 +35,7 @@ jobs: - name: Cache CPAN Modules uses: actions/cache@v2 with: - path: local/lib + path: local key: perl-${{ steps.perl.outputs.perl-hash }} - name: Download cpanfile uses: carlosperate/download-file-action@v1.0.3 diff --git a/.github/workflows/firebird.yml b/.github/workflows/firebird.yml index 5d62a0d8e..e31bd6f4d 100644 --- a/.github/workflows/firebird.yml +++ b/.github/workflows/firebird.yml @@ -39,7 +39,7 @@ jobs: - name: Cache CPAN Modules uses: actions/cache@v2 with: - path: local/lib + path: local key: perl-${{ steps.perl.outputs.perl-hash }} - name: Download cpanfile uses: carlosperate/download-file-action@v1.0.3 @@ -47,11 +47,9 @@ jobs: file-url: https://fastapi.metacpan.org/source/DWHEELER/App-Sqitch-v1.1.0/dist/cpanfile - run: cpm install --verbose --show-build-log-on-failure --no-test --with-recommends --cpanfile cpanfile - run: cpm install --verbose --show-build-log-on-failure --no-test --with-recommends DBD::Firebird - env: { FIREBIRD_HOME: /usr } - name: prove env: PERL5LIB: "${{ github.workspace }}/local/lib/perl5" LIVE_FIREBIRD_REQUIRED: true - FIREBIRD_HOME: /usr SQITCH_TEST_FIREBIRD_URI: db:firebird://sysdba:nix@127.0.0.1:${{ job.services.firebird.ports[3050] }}//firebird/data/sqitchtest.db run: prove -lvr t/firebird.t diff --git a/.github/workflows/mysql.yml b/.github/workflows/mysql.yml index 2bb7de304..b2bb42972 100644 --- a/.github/workflows/mysql.yml +++ b/.github/workflows/mysql.yml @@ -45,7 +45,7 @@ jobs: - name: Cache CPAN Modules uses: actions/cache@v2 with: - path: local/lib + path: local key: perl-${{ steps.perl.outputs.perl-hash }} - name: Download cpanfile uses: carlosperate/download-file-action@v1.0.3 diff --git a/.github/workflows/oracle.yml b/.github/workflows/oracle.yml index be3d386fa..5cca950cb 100644 --- a/.github/workflows/oracle.yml +++ b/.github/workflows/oracle.yml @@ -15,11 +15,12 @@ jobs: # In 11g, APP_USER "sqitchtest" is created in XE, but in more recent # versions it is created in the XEPDB1 pluggable database, which we # cannot connect to using a URI. So we use an existing user in those - # versions. + # versions. Uncomment code in skip_unless in t/oracle.t to find other + # user schemas that will work. # * Image Source: https://github.com/gvenzl/oci-oracle-xe/ # * Image Issue: https://github.com/gvenzl/oci-oracle-xe/issues/46 # * DBD::Oracle Issue: https://github.com/perl5-dbi/DBD-Oracle/issues/131 - # - { version: 21c, tag: 21-full, service: XE, altUser: gsmuser } + - { version: 21c, tag: 21, service: XE, altUser: dbsnmp } - { version: 18c, tag: 18-slim, service: XE, altUser: gsmuser } - { version: 11g, tag: 11-slim, service: XE, altuser: sqitchtest } name: "๐Ÿ”ฎ Oracle ${{ matrix.version }}" @@ -38,7 +39,6 @@ jobs: --health-timeout 10s --health-retries 10 steps: - - run: "echo Filter: ${{ needs.filter.outputs.oracle }}" - uses: actions/checkout@v2 - name: Setup Clients run: .github/ubuntu/oracle.sh @@ -49,7 +49,7 @@ jobs: - name: Cache CPAN Modules uses: actions/cache@v2 with: - path: local/lib + path: local key: perl-${{ steps.perl.outputs.perl-hash }} - name: Download cpanfile uses: carlosperate/download-file-action@v1.0.3 diff --git a/.github/workflows/os.yml b/.github/workflows/os.yml index 54d9c7b88..45d31f698 100644 --- a/.github/workflows/os.yml +++ b/.github/workflows/os.yml @@ -24,7 +24,7 @@ jobs: - name: Cache CPAN Modules uses: actions/cache@v2 with: - path: local/lib + path: local key: perl-${{ steps.perl.outputs.perl-hash }} - name: Download cpanfile uses: carlosperate/download-file-action@v1.0.3 @@ -37,4 +37,4 @@ jobs: - run: cpm install --verbose --show-build-log-on-failure --no-test --with-recommends Test::Spelling Test::Pod Test::Pod::Coverage - name: prove env: { PERL5LIB: "${{ github.workspace }}/local/lib/perl5" } - run: prove -lr --comments --directives + run: prove -lrj4 diff --git a/.github/workflows/perl.yml b/.github/workflows/perl.yml index 1ae14ee66..c7b4020d2 100644 --- a/.github/workflows/perl.yml +++ b/.github/workflows/perl.yml @@ -28,7 +28,7 @@ jobs: - name: Cache CPAN Modules uses: actions/cache@v2 with: - path: local/lib + path: local key: perl-${{ steps.perl.outputs.perl-hash }} - name: Download cpanfile uses: carlosperate/download-file-action@v1.0.3 @@ -41,4 +41,4 @@ jobs: - run: cpm install --verbose --show-build-log-on-failure --no-test --with-recommends Test::Spelling Test::Pod Test::Pod::Coverage - name: prove env: { PERL5LIB: "${{ github.workspace }}/local/lib/perl5" } - run: prove -lr --comments --directives + run: prove -lrj4 diff --git a/.github/workflows/pg.yml b/.github/workflows/pg.yml index d6938606d..fff277bd3 100644 --- a/.github/workflows/pg.yml +++ b/.github/workflows/pg.yml @@ -23,7 +23,7 @@ jobs: - name: Cache CPAN Modules uses: actions/cache@v2 with: - path: local/lib + path: local key: perl-${{ steps.perl.outputs.perl-hash }} - name: Download cpanfile uses: carlosperate/download-file-action@v1.0.3 diff --git a/.github/workflows/snowflake.yml b/.github/workflows/snowflake.yml index cd338c70e..ed83ac9d8 100644 --- a/.github/workflows/snowflake.yml +++ b/.github/workflows/snowflake.yml @@ -21,7 +21,7 @@ jobs: - name: Cache CPAN Modules uses: actions/cache@v2 with: - path: local/lib + path: local key: perl-${{ steps.perl.outputs.perl-hash }} - name: Download cpanfile uses: carlosperate/download-file-action@v1.0.3 diff --git a/.github/workflows/sqlite.yml b/.github/workflows/sqlite.yml index 99934a60a..1201580b9 100644 --- a/.github/workflows/sqlite.yml +++ b/.github/workflows/sqlite.yml @@ -24,7 +24,7 @@ jobs: - name: Cache CPAN Modules uses: actions/cache@v2 with: - path: local/lib + path: local key: perl-${{ steps.perl.outputs.perl-hash }} - name: Download cpanfile uses: carlosperate/download-file-action@v1.0.3 diff --git a/.github/workflows/vertica.yml b/.github/workflows/vertica.yml index 21b1561ed..c099cd1a3 100644 --- a/.github/workflows/vertica.yml +++ b/.github/workflows/vertica.yml @@ -37,7 +37,7 @@ jobs: - name: Cache CPAN Modules uses: actions/cache@v2 with: - path: local/lib + path: local key: perl-${{ steps.perl.outputs.perl-hash }} - name: Download cpanfile uses: carlosperate/download-file-action@v1.0.3 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index cdaf95522..000000000 --- a/.travis.yml +++ /dev/null @@ -1,247 +0,0 @@ -language: perl -stage: ๐Ÿช Perl -perl: - - "5.30" - - "5.28" - - "5.26" - - "5.24" - - "5.22" - - "5.20" - - "5.18" - - "5.16" - - "5.14" - - "5.12" - - "5.10" -before_install: - - source dev/linux-prereqs -install: - - cpan-install --deps -script: - - prove -lr --directives --comments $(test-dirs) - -jobs: - include: - - stage: ๐Ÿ“ Windows - os: windows - language: shell - before_install: - - cinst -y strawberryperl - - export "PATH=/c/Strawberry/perl/site/bin:/c/Strawberry/perl/bin:/c/Strawberry/c/bin:$PATH" - install: - # Last release doesn't depend on Test::MockObject::Extends - - cpanm --no-interactive --no-man-pages --notest Test::MockObject::Extends - # Can't use dzil to make a dist on windows, so depend on the previous - # release for dependencies. - - cpanm --no-interactive --no-man-pages --notest --installdeps App::Sqitch - script: - # No prove: https://rt.cpan.org/Public/Bug/Display.html?id=128221 - - ./dev/prove -lr t - - - stage: ๐Ÿ“ˆ Coverage - if: branch = main OR branch =~ /(?i:cover)/ - services: docker - env: COVERAGE=1 - before_install: - - source dev/linux-exasol - - source dev/linux-firebird - - source dev/linux-mysql - - source dev/linux-oracle - - source dev/linux-postgres - - source dev/linux-snowflake - - source dev/linux-sqlite - - source dev/linux-vertica - - source dev/linux-prereqs - - cpan-install --deps - - cpan-install --coverage - before_script: - - coverage-setup - script: - - export AUTHOR_TESTING=1 LIVE_PG_REQUIRED=1 LIVE_MYSQL_REQUIRED=1 LIVE_SQLITE_REQUIRED=1 LIVE_VERTICA_REQUIRED=1 LIVE_EXASOL_REQUIRED=1 LIVE_FIREBIRD_REQUIRED=1 - - prove -lr --directives --comments $(test-dirs) - # - prove -lv t/sqlite.t t/pg.t t/mysql.t t/vertica.t t/exasol.t t/firebird.t t/oracle.t t/snowflake.t - after_success: - - coverage-report - - - &postgres - stage: ๐Ÿ˜ Postgres - if: branch = main OR branch =~ /(?i:pgsql|postgre(?i:sql)?)/ - env: POSTGRES=11 - before_install: - - source dev/linux-postgres - - source dev/linux-prereqs - script: - - LIVE_PG_REQUIRED=1 prove -lr --directives --comments t/pg.t - - <<: *postgres - env: POSTGRES=10 - - <<: *postgres - env: POSTGRES=9.6 - - <<: *postgres - env: POSTGRES=9.5 - - <<: *postgres - env: POSTGRES=9.4 - - <<: *postgres - env: POSTGRES=9.3 - - <<: *postgres - env: POSTGRES=9.2 - - <<: *postgres - env: POSTGRES=9.1 - - <<: *postgres - env: POSTGRES=9.0 - - <<: *postgres - env: POSTGRES=8.4 - - # https://sqlite.org/chronology.html - - &sqlite - stage: ๐Ÿ’ก SQLite - if: branch = main OR branch =~ /(?i:sqlite)/ - env: SQLITE=3.26.0 - before_install: - - source dev/linux-sqlite - - source dev/linux-prereqs - script: - - LIVE_SQLITE_REQUIRED=1 prove -lr --directives --comments t/sqlite.t - - <<: *sqlite - env: SQLITE=3.25.3 - - <<: *sqlite - env: SQLITE=3.24.0 - - <<: *sqlite - env: SQLITE=3.23.1 - - <<: *sqlite - env: SQLITE=3.22.0 - - <<: *sqlite - env: SQLITE=3.21.0 - - <<: *sqlite - env: SQLITE=3.20.1 - - <<: *sqlite - env: SQLITE=3.19.3 - - <<: *sqlite - env: SQLITE=3.18.0 - - <<: *sqlite - env: SQLITE=3.17.0 - - <<: *sqlite - env: SQLITE=3.16.2 - - <<: *sqlite - env: SQLITE=3.15.2 - - <<: *sqlite - env: SQLITE=3.14.2 - - <<: *sqlite - env: SQLITE=3.13.0 - - <<: *sqlite - env: SQLITE=3.12.2 - - <<: *sqlite - env: SQLITE=3.11.1 - - <<: *sqlite - env: SQLITE=3.10.2 - - <<: *sqlite - env: SQLITE=3.9.2 - - <<: *sqlite - env: SQLITE=3.8.11.1 - - <<: *sqlite - env: SQLITE=3.7.17 - - # https://hub.docker.com/_/mysql - # https://hub.docker.com/_/mariadb - - &mysql - stage: ๐Ÿฌ MySQL - if: branch = main OR branch =~ /(?i:mysql)/ - services: docker - env: MYSQL=mysql:8.0 - before_install: - - source dev/linux-mysql - - source dev/linux-prereqs - script: - - LIVE_MYSQL_REQUIRED=1 prove -lr --directives --comments t/mysql.t - - <<: *mysql - env: MYSQL=mysql:5.7 - - <<: *mysql - env: MYSQL=mysql:5.6 - - <<: *mysql - env: MYSQL=mysql:5.5 - - <<: *mysql - env: MYSQL=mariadb:10.4 - - <<: *mysql - env: MYSQL=mariadb:10.3 - - <<: *mysql - env: MYSQL=mariadb:10.2 - - <<: *mysql - env: MYSQL=mariadb:10.1 - - <<: *mysql - env: MYSQL=mariadb:10.0 - - <<: *mysql - env: MYSQL=mariadb:5.5 - - # https://hub.docker.com/r/cjonesy/docker-vertica/tags - - &vertica - stage: ๐Ÿ”บ Vertica - if: branch = main OR branch =~ /(?i:vertica)/ - env: VERTICA=9.1.1-0 - before_install: - - source dev/linux-vertica - - source dev/linux-prereqs - script: - - LIVE_VERTICA_REQUIRED=1 prove -lr --directives --comments t/vertica.t - - <<: *vertica - env: VERTICA=8.1.1-0 - - <<: *vertica - env: VERTICA=8.0.0-0 - - <<: *vertica - env: VERTICA=7.2.3-18 - - <<: *vertica - env: VERTICA=7.1.2-21 - - # https://hub.docker.com/r/exasol/docker-db/tags - - &exasol - stage: โ˜€๏ธ Exasol - if: branch = main OR branch =~ /(?i:exasol)/ - env: EXASOL=6.1.1-d1 - before_install: - - source dev/linux-exasol - - source dev/linux-prereqs - script: - - LIVE_EXASOL_REQUIRED=1 prove -lr --directives --comments t/exasol.t - - <<: *exasol - env: EXASOL=6.0.13-d1 - - # https://hub.docker.com/r/jacobalberty/firebird/tags - - &firebird - stage: ๐Ÿ”ฅ Firebird - if: branch = main OR branch =~ /(?i:firebird)/ - env: FIREBIRD=3.0 - before_install: - - source dev/linux-firebird - - source dev/linux-prereqs - script: - - LIVE_FIREBIRD_REQUIRED=1 prove -lr --directives --comments t/firebird.t - - <<: *firebird - env: FIREBIRD=2.5-ss - - <<: *firebird - env: FIREBIRD=2.5-sc - - - stage: โ„๏ธ Snowflake - # No support for live Snowflake testing, can't download the ODBC driver - # except through the web interface. So just run if the branch looks like - # it's relevant to Snowflake. - if: branch =~ /(?i:snow(?:flake|sql))/ - before_install: - - source dev/linux-snowflake - - source dev/linux-prereqs - script: - - LIVE_SNOWFLAKE_REQUIRED=1 prove -lr --directives --comments t/snowflake.t - - - &oracle - # No support for live Oracle testing, can't download the instantclient - # stuff or run an Oracle server on Travis. So just run if the branch looks - # ilke it's relevant to Oracle. - stage: ๐Ÿ”ฎ Oracle - if: branch =~ /(?i:or(?:acle|cl))/ - env: ORACLE=18c - before_install: - - source dev/linux-oracle - - source dev/linux-prereqs - script: - - LIVE_ORACLE_REQUIRED=1 prove -lr --directives --comments t/oracle.t - - fast_finish: true - allow_failures: - - stage: โ„๏ธ Snowflake - - stage: ๐Ÿ”ฎ Oracle diff --git a/MANIFEST.SKIP b/MANIFEST.SKIP index fc88ebf32..be474f147 100644 --- a/MANIFEST.SKIP +++ b/MANIFEST.SKIP @@ -3,7 +3,6 @@ \bCVS\b ,v$ \B\.git -\B\.travis\.yml # Avoid Makemaker generated and utility files. \bMakefile$ diff --git a/README.md b/README.md index ecb027617..bd393d212 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,18 @@ App/Sqitch version v1.1.1 ========================= -[![CPAN version](https://badge.fury.io/pl/App-Sqitch.svg)](https://badge.fury.io/pl/App-Sqitch) -[![Build Status](https://travis-ci.com/sqitchers/sqitch.svg)](https://travis-ci.com/sqitchers/sqitch) -[![Coverage Status](https://coveralls.io/repos/sqitchers/sqitch/badge.svg)](https://coveralls.io/r/sqitchers/sqitch) +| Release | Coverage | Database || +|-------------------|-------------------|-------------------|-------------------| +| [![CPAN]][๐Ÿ“š] | [![OSes]][๐Ÿ’ฟ] | [![Exasol]][โ˜€๏ธ] | [![Oracle]][๐Ÿ”ฎ] | +| [![Docker]][๐Ÿณ] | [![Perl]][๐Ÿช] | [![Firebird]][๐Ÿ”ฅ] | [![Snowflake]][โ„๏ธ] | +| [![Homebrew]][๐Ÿบ] | [![Coverage]][๐Ÿ“ˆ] | [![MySQL]][๐Ÿฌ] | [![SQLite]][๐Ÿ’ก] | +| [![Debian]][๐Ÿฅ] | | [![Postgres]][๐Ÿ˜] | [![Vertica]][๐Ÿ”บ] | -[Sqitch](https://sqitch.org/) is a database change management application. It -currently supports PostgreSQL 8.4+, SQLite 3.7.11+, MySQL 5.0+, Oracle 10g+, -Firebird 2.0+, Vertica 6.0+, Exasol 6.0+ and Snowflake. +[Sqitch] is a database change management application. It currently supports +PostgreSQL 8.4+, SQLite 3.7.11+, MySQL 5.0+, Oracle 10g+, Firebird 2.0+, Vertica +6.0+, Exasol 6.0+ and Snowflake. -What makes it different from your typical -[migration](https://guides.rubyonrails.org/migrations.html) approaches? A few -things: +What makes it different from your typical migration approaches? A few things: * No opinions @@ -21,12 +22,9 @@ things: * Native scripting - Changes are implemented as scripts native to your selected database - engine. Writing a [PostgreSQL](https://postgresql.org/) application? Write - SQL scripts for - [`psql`](https://www.postgresql.org/docs/current/static/app-psql.html). - Writing an [Oracle](https://www.oracle.com/database/)-backed app? - Write SQL scripts for [SQL\*Plus](https://www.orafaq.com/wiki/SQL*Plus). + Changes are implemented as scripts native to your selected database engine. + Writing a [PostgreSQL] application? Write SQL scripts for [`psql`]. Writing + an [Oracle]-backed app? Write SQL scripts for [SQL\*Plus]. * Dependency resolution @@ -37,48 +35,41 @@ things: * Deployment integrity Sqitch manages changes and dependencies via a plan file, and employs a - [Merkle tree](https://en.wikipedia.org/wiki/Merkle_tree "Wikipedia: โ€œMerkle treeโ€") - pattern similar to - [Git](https://stackoverflow.com/a/18589734/ "Stack Overflow: โ€œWhat is the mathematical structure that represents a Git repoโ€") - and [Blockchain](https://medium.com/byzantine-studio/blockchain-fundamentals-what-is-a-merkle-tree-d44c529391d7 "Medium: โ€œBlockchain Fundamentals #1: What is a Merkle Tree?โ€") - to ensure deployment integrity. - As such, there is no need to number your changes, although you can if you - want. Sqitch doesn't much care how you name your changes. + [Merkle tree] pattern similar to [Git][gitmerkle] and [Blockchain] to ensure + deployment integrity. As such, there is no need to number your changes, + although you can if you want. Sqitch doesn't much care how you name your + changes. * Iterative Development - Up until you [tag](https://sqitch.org/docs/manual/sqitch-tag/) and - [release](https://sqitch.org/docs/manual/sqitch-tag/) your project, you - can modify your change deployment scripts as often as you like. They're - not locked in just because they've been committed to your VCS. This allows - you to take an iterative approach to developing your database schema. Or, - better, you can do test-driven database development. + Up until you [tag] and [release] your project, you can modify your change + deployment scripts as often as you like. They're not locked in just because + they've been committed to your VCS. This allows you to take an iterative + approach to developing your database schema. Or, better, you can do + test-driven database development. Want to learn more? The best place to start is in the tutorials: -* [Introduction to Sqitch on PostgreSQL](lib/sqitchtutorial.pod) -* [Introduction to Sqitch on SQLite](lib/sqitchtutorial-sqlite.pod) -* [Introduction to Sqitch on Oracle](lib/sqitchtutorial-oracle.pod) -* [Introduction to Sqitch on MySQL](lib/sqitchtutorial-mysql.pod) -* [Introduction to Sqitch on Firebird](lib/sqitchtutorial-firebird.pod) -* [Introduction to Sqitch on Vertica](lib/sqitchtutorial-vertica.pod) -* [Introduction to Sqitch on Exasol](lib/sqitchtutorial-exasol.pod) -* [Introduction to Sqitch on Snowflake](lib/sqitchtutorial-snowflake.pod) +* [Introduction to Sqitch on PostgreSQL](lib/sqitchtutorial.pod) +* [Introduction to Sqitch on SQLite](lib/sqitchtutorial-sqlite.pod) +* [Introduction to Sqitch on Oracle](lib/sqitchtutorial-oracle.pod) +* [Introduction to Sqitch on MySQL](lib/sqitchtutorial-mysql.pod) +* [Introduction to Sqitch on Firebird](lib/sqitchtutorial-firebird.pod) +* [Introduction to Sqitch on Vertica](lib/sqitchtutorial-vertica.pod) +* [Introduction to Sqitch on Exasol](lib/sqitchtutorial-exasol.pod) +* [Introduction to Sqitch on Snowflake](lib/sqitchtutorial-snowflake.pod) There have also been a number of presentations on Sqitch: -* [PDX.pm Presentation](https://speakerdeck.com/theory/sane-database-change-management-with-sqitch): - Slides from "Sane Database Management with Sqitch", presented to the - Portland Perl Mongers in January, 2013. +* [PDX.pm Presentation]: Slides from "Sane Database Management with Sqitch", + presented to the Portland Perl Mongers in January, 2013. -* [PDXPUG Presentation](https://vimeo.com/50104469): Movie of "Sane Database - Management with Sqitch", presented to the Portland PostgreSQL Users Group in - September, 2012. +* [PDXPUG Presentation]: Movie of "Sane Database Management with Sqitch", + presented to the Portland PostgreSQL Users Group in September, 2012. -* [Agile Database Development](https://speakerdeck.com/theory/agile-database-development-2ed): - Slides from a three-hour tutorial session on using [Git](https://git-scm.org), - test-driven development with [pgTAP](https://pgtap.org), and change - management with Sqitch, updated in January, 2014. +* [Agile Database Development]: Slides from a three-hour tutorial session on + using [Git], test-driven development with [pgTAP], and change management with + Sqitch, updated in January, 2014. Installation ------------ @@ -98,7 +89,7 @@ To install Sqitch and all of its dependencies into a single directory named ./Build bundle --install_base sqitch_bundle After which, Sqitch can be run from `./sqitch_bundle/bin/sqitch`. By default, -no modules that are included in the core Perl distrituion are included. To +no modules that are included in the core Perl distribution are included. To require that dual-life modules also be bundled, pass `--dual_life 1`: ./Build bundle --install_base sqitch_bundle --dual_life 1 @@ -121,8 +112,7 @@ supported features are: * `--with snowflake`: Support for managing Snowflake databases * `--with odbc`: Include the ODBC driver -To build from a Git clone, first install -[Dist::Zilla](https://metacpan.org/module/Dist::Zilla), then use it to install +To build from a Git clone, first install [Dist::Zilla], then use it to install Sqitch and all dependencies: cpanm Dist::Zilla @@ -133,8 +123,7 @@ Sqitch and all dependencies: To run Sqitch directly from the Git clone, execute `t/sqitch`. To install Sqitch on a specific platform, including Debian- and RedHat-derived -Linux distributions and Windows, see the -[Installation documentation](https://sqitch.org/#installation). +Linux distributions and Windows, see the [Installation documentation]. License ------- @@ -158,3 +147,54 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + [CPAN]: https://img.shields.io/cpan/v/App-Sqitch?label=%F0%9F%93%9A%20CPAN + [๐Ÿ“š]: https://metacpan.org/dist/App-Sqitch "Latest version on CPAN" + [OSes]: https://github.com/sqitchers/sqitch/actions/workflows/os.yml/badge.svg?branch=develop + [๐Ÿ’ฟ]: https://github.com/sqitchers/sqitch/actions/workflows/os.yml "Tested on Linux, macOS, and Windows" + [Exasol]: https://github.com/sqitchers/sqitch/actions/workflows/exasol.yml/badge.svg?branch=develop + [โ˜€๏ธ]: https://github.com/sqitchers/sqitch/actions/workflows/exasol.yml "Tested with Exasol 7.0โ€“7.1" + [Oracle]: https://github.com/sqitchers/sqitch/actions/workflows/oracle.yml/badge.svg?branch=develop + [๐Ÿ”ฎ]: https://github.com/sqitchers/sqitch/actions/workflows/oracle.yml "Tested with Oracle 11, 18, and 21" + [Docker]: https://img.shields.io/docker/v/sqitch/sqitch?label=%F0%9F%90%B3%20Docker&sort=semver + [๐Ÿณ]: https://hub.docker.com/r/sqitch/sqitch "Latest version on Docker Hub" + [Perl]: https://github.com/sqitchers/sqitch/actions/workflows/perl.yml/badge.svg?branch=develop + [๐Ÿช]: https://github.com/sqitchers/sqitch/actions/workflows/perl.yml "Tested with Perl 5.12โ€“5.34" + [Firebird]: https://github.com/sqitchers/sqitch/actions/workflows/firebird.yml/badge.svg?branch=develop + [๐Ÿ”ฅ]: https://github.com/sqitchers/sqitch/actions/workflows/firebird.yml "Tested with Firebird 2.5, 3, and 4" + [Snowflake]: https://github.com/sqitchers/sqitch/actions/workflows/snowflake.yml/badge.svg?branch=develop + [โ„๏ธ]: https://github.com/sqitchers/sqitch/actions/workflows/snowflake.yml "Tested with Snowflake" + [Homebrew]: https://img.shields.io/github/v/tag/sqitchers/homebrew-sqitch?label=%F0%9F%8D%BA%20Homebrew&sort=semver + [๐Ÿบ]: https://github.com/sqitchers/homebrew-sqitch#readme "Latest Homebrew Tap version" + [Coverage]: https://img.shields.io/coveralls/github/sqitchers/sqitch/develop?label=%F0%9F%93%88%20Coverage + [๐Ÿ“ˆ]: https://coveralls.io/r/sqitchers/sqitch "Test Coverage" + [MySQL]: https://github.com/sqitchers/sqitch/actions/workflows/mysql.yml/badge.svg?branch=develop + [๐Ÿฌ]: https://github.com/sqitchers/sqitch/actions/workflows/mysql.yml "Tested with MySQL 5.5โ€“8 and MariaDB 10.0โ€“10.6" + [SQLite]: https://github.com/sqitchers/sqitch/actions/workflows/sqlite.yml/badge.svg?branch=develop + [๐Ÿ’ก]: https://github.com/sqitchers/sqitch/actions/workflows/sqlite.yml "Tested with SQLite 3.7โ€“3.36" + [Debian]: https://img.shields.io/debian/v/sqitch?label=%F0%9F%8D%A5%20Debian + [๐Ÿฅ]: https://packages.debian.org/stable/sqitch "Latest version on Debian" + [Postgres]: https://github.com/sqitchers/sqitch/actions/workflows/pg.yml/badge.svg?branch=develop + [๐Ÿ˜]: https://github.com/sqitchers/sqitch/actions/workflows/pg.yml "Tested with PostgreSQL 9.3โ€“14" + [Vertica]: https://github.com/sqitchers/sqitch/actions/workflows/vertica.yml/badge.svg?branch=develop + [๐Ÿ”บ]: https://github.com/sqitchers/sqitch/actions/workflows/vertica.yml "Tested with Vertica 7.1โ€“11.0" + + [Sqitch]: https://sqitch.org/ + [PostgreSQL]: https://postgresql.org/ + [`psql`]: https://www.postgresql.org/docs/current/static/app-psql.html + [Oracle]: https://www.oracle.com/database/ + [SQL\*Plus]: https://www.orafaq.com/wiki/SQL*Plus + [Merkle tree]: https://en.wikipedia.org/wiki/Merkle_tree "Wikipedia: โ€œMerkle treeโ€" + [gitmerkle]: https://stackoverflow.com/a/18589734/ + "Stack Overflow: โ€œWhat is the mathematical structure that represents a Git repoโ€" + [Blockchain]: https://medium.com/byzantine-studio/blockchain-fundamentals-what-is-a-merkle-tree-d44c529391d7 + "Medium: โ€œBlockchain Fundamentals #1: What is a Merkle Tree?โ€" + [tag]: https://sqitch.org/docs/manual/sqitch-tag/ + [release]: https://sqitch.org/docs/manual/sqitch-tag/ + [PDX.pm Presentation]: https://speakerdeck.com/theory/sane-database-change-management-with-sqitch + [PDXPUG Presentation]: https://vimeo.com/50104469 + [Agile Database Development]: https://speakerdeck.com/theory/agile-database-development-2ed + [Git]: https://git-scm.org + [pgTAP]: https://pgtap.org + [Dist::Zilla]: https://metacpan.org/module/Dist::Zilla + [Installation documentation]: https://sqitch.org/download/ diff --git a/t/firebird.t b/t/firebird.t index e65fb471f..dd3ef950e 100644 --- a/t/firebird.t +++ b/t/firebird.t @@ -316,7 +316,7 @@ my $err = try { }; END { - return if $ENV{CI}; # No need to clean up under Travis. + return if $ENV{CI}; # No need to clean up in CI environment. foreach my $dbname (@cleanup) { $uri->dbname($dbname); my $dsn = $uri->dbi_dsn . q{;ib_dialect=3;ib_charset=UTF8}; diff --git a/t/lib/DBIEngineTest.pm b/t/lib/DBIEngineTest.pm index 2f7926452..ff0d7f035 100644 --- a/t/lib/DBIEngineTest.pm +++ b/t/lib/DBIEngineTest.pm @@ -28,7 +28,7 @@ sub run { my $mock_change = Test::MockModule->new('App::Sqitch::Plan::Change'); my @lines = grep { $_ } file('README.md')->slurp( chomp => 1, - iomode => '<:encoding(UTF-8)' + iomode => '<:raw' ); # Each change should retain its own hash. my $orig_deploy_hash; diff --git a/t/oracle.t b/t/oracle.t index ff0ed1e36..ae88142c5 100644 --- a/t/oracle.t +++ b/t/oracle.t @@ -585,6 +585,7 @@ END { "DROP TABLE $alt_reg.releases", "DROP TYPE $alt_reg.sqitch_array", ); + $dbh->disconnect; } my $uri = $ENV{SQITCH_TEST_ORACLE_URI} ? URI->new($ENV{SQITCH_TEST_ORACLE_URI}) : do { @@ -614,6 +615,22 @@ DBIEngineTest->run( skip_unless => sub { my $self = shift; die $err if $err; + + ##### + ## Uncomment to find another user/schema to use for the alternate + # schema in .github/workflows/oracle.yml. + # my $dbh = $self->dbh; + # for my $u (@{ $dbh->selectcol_arrayref('SELECT USERNAME FROM all_users') }) { + # my $result = 'success'; + # try { + # $dbh->do("CREATE TABLE $u.try(id FLOAT)"); + # $dbh->do("INSERT INTO $u.try VALUES(?)", undef, 1.0); + # } catch { + # $result = 'fail'; + # }; + # Test::More::diag("$u: $result"); + # } + # Make sure we have sqlplus and can connect to the database. $self->sqitch->probe( $self->client, '-v' ); my $v = $self->sqitch->capture( $self->client, '-v' );