Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable build matrix for travis #2261

Merged
merged 1 commit into from
Aug 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
enable build matrix for travis
Additional tests are introduced and they do not fit
into the time limit for one job, splitting them
to multiple jobs help.

Each supported database type is tested in separate jobs.
  • Loading branch information
Gyorgy Orban committed Aug 7, 2019
commit 7c501b30ced1f92e0b1a1dae95f2923433446e93
58 changes: 51 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
language:
language:
- python

services:
Expand All @@ -11,12 +11,52 @@ matrix:
sudo: required
dist: xenial
python: "2.7"
env: CC_MODULE=analyzer
- os: linux
name: "Server/client test cases (sqlite)"
sudo: required
dist: xenial
python: "2.7"
env: DATABASE=sqlite
- os: linux
name: "Server/client test cases (psycopg2)"
sudo: required
dist: xenial
python: "2.7"
env: DATABASE=psql_psycopg2
- os: linux
name: "Server/client test cases (pg8000)"
sudo: required
dist: xenial
python: "2.7"
env: DATABASE=psql_pg8000
- os: osx
osx_image: xcode9.4
name: "Analyzer test cases"
sudo: false
language: generic
env: CC_MODULE=analyzer
- os: osx
osx_image: xcode9.4
name: "Server/client test cases (sqlite)"
sudo: false
language: generic
env: DATABASE=sqlite
- os: osx
osx_image: xcode9.4
name: "Server/client test cases (psycopg2)"
sudo: false
language: generic
env:
- DATABASE=psql_psycopg2
- POSTGRESQL_VERSION=9.6
- os: osx
osx_image: xcode9.4
name: "Analyzer, web (sqlite, psycopg2, pg8000) and tools test cases."
sudo: false
language: generic
env:
- DATABASE=psql_pg8000
- POSTGRESQL_VERSION=9.6

before_install:
Expand Down Expand Up @@ -91,9 +131,13 @@ script:
make clean_travis &&
make package &&
make -C tools/plist_to_html test &&
BUILD_DIR=$TRAVIS_BUILD_DIR/build make -C analyzer test_unit test_functional &&
if [[ "$TRAVIS_OS_NAME" = "linux" ]]; then
make -C analyzer test_tu_collector test_build_logger;
fi &&
BUILD_DIR=$TRAVIS_BUILD_DIR/build make -C web test_unit test_functional &&
make clean_travis
if [[ "$CC_MODULE" = "analyzer" ]]; then
BUILD_DIR=$TRAVIS_BUILD_DIR/build make -C analyzer test_unit test_functional test_tu_collector;
if [[ "$TRAVIS_OS_NAME" = "linux" ]]; then
make -C analyzer test_build_logger
fi
elif [[ ! -z "$DATABASE" ]]; then
make -C web test_matrix_${DATABASE};
else
make test;
fi
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,14 @@ test_web:
test_web_sqlite:
BUILD_DIR=$(BUILD_DIR) $(MAKE) -C $(CC_WEB) test_sqlite

# Run all the functional tests for the web with psycopg2.
test_web_psql_psycopg2:
BUILD_DIR=$(BUILD_DIR) $(MAKE) -C $(CC_WEB) test_psql_psycopg2

# Run all the functional tests for the web with pg8000.
test_web_psql_pg8000:
BUILD_DIR=$(BUILD_DIR) $(MAKE) -C $(CC_WEB) test_psql_pg8000

# Run a specific web test.
test_web_feature:
BUILD_DIR=$(BUILD_DIR) $(MAKE) -C $(CC_WEB) run_test
Expand Down
10 changes: 10 additions & 0 deletions web/tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -144,3 +144,13 @@ test_psql_pg8000_in_env: venv_dev

test_clean:
$(CLEAR_WORKSPACE_CMD)

# Use the proper requirement file for the given test configuration
test_matrix_sqlite: VENV_DEV_REQ_FILE = web/requirements_py/dev/requirements.txt
test_matrix_sqlite: test_unit test_sqlite

test_matrix_psql_psycopg2: VENV_DEV_REQ_FILE = web/requirements_py/db_psycopg2/requirements.txt
test_matrix_psql_psycopg2: test_unit test_psql_psycopg2

test_matrix_psql_pg8000: VENV_DEV_REQ_FILE = requirements_py/db_pg8000/requirements.txt
test_matrix_psql_pg8000: test_unit test_psql_pg8000