Skip to content

Commit 586f303

Browse files
authored
Implement an in-memory store using SQLite (#147)
* php-cs-fixer: added further files * updated README to show Github action status badges instead of travis + coveralls + further refinements * further coding style issue fixes in tests/ * first step towards SQLite support * prepered basic classes * copied ARC2_StoreTableManager to provide create table functions for SQLite instead * further preparations to allow SQLite; many refinements + moved Adapter tests to tests/integration + removed further @'s before functions * github actions: added dedicated SQLite case * removed StoreTest::testProcessTables because it fails local but not in CI * added further checks before run mysql related tests * removed Makefile and simplified phpunit.xml * SQLite compatibility: further improvements * fixed/adapted further tests only failures left * added a var_dump to ARC2_ClassTest to see why SQLite tests are failing * tests/bootstrap.php: fixed mysqli-if clause * reworked tests/bootstrap.php to either custom config or only predefined values but not both * tests/bootstrap.php: check $_SERVER vor env vars too * github actions: reworked test approach * github actions: fixed wrong php-reference * SQLite related refinements in bootstrap.php * tests/bootstrap: fixed outdated variable * tests/bootstrap.php: fixed misspelling in $dbConfig['db_pdo_protocol'] * further fixes in test environment * ARC2_ClassTest: removed var_dump * re-added remaining MariaDB test cases (10.2-10.5) * renamed PDOSQLite to PDOSQLiteAdapter; enabled further tests * updated README.md, added MySQL 5.6 to tests * added var_dump to bootstrap.php again * CachedPDOAdapterTest added check for dbConfig['db_pdo_protocol'] to avoid index access problems * another small fix for CachedPDOAdapterTest * force PDOSQLiteAdapterTest to use SQLite config * fixed array access problem in PDOSQLiteAdapterTest * for mysqli: fixed PDOSQLiteAdapterTest configuration usage * fixed further SQLite related test problems * SQLite: fixed relational expression SQL * made SelectQueryTest::testSelectLeftJoinUsingOptional more clear * added var_dump to find out why testReplace is failing ref: https://github.com/semsol/arc2/pull/147/checks?check_run_id=1618107109#step:5:24 * added further echos to debug * removed all workflow files except for SQLite to get faster test results the problem is that I can't reproduce the error locally. * made ARC2_StoreTest::testSetup to do an assertion * hopefully fixed ARC2_StoreTest::getGraphs problem was, it missed table prefix in some cases * re-added ALL workflow files; enabled all SQLite tests * removed debug output * fixed mysql 5.6 workflow (used 5.7 too) * added mysql 5.5 workflow * README.md: updated status for mysql 5.5 * README.md: added MySQL 5.5 test status badge * README.md: added section for new in-memory store
1 parent d3e2114 commit 586f303

93 files changed

Lines changed: 8053 additions & 5784 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/SQLite.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: SQLite Tests
2+
3+
on: push
4+
5+
jobs:
6+
sqlite-in-memory:
7+
name: |
8+
SQLite Tests - PHP ${{ matrix.php }} in memory
9+
runs-on: ubuntu-latest
10+
11+
env:
12+
DB_ADAPTER: pdo
13+
DB_PDO_PROTOCOL: sqlite
14+
DB_SQLITE_IN_MEMORY: true
15+
16+
strategy:
17+
# if one of the matrix-entries break, all entries getting canceled.
18+
fail-fast: true
19+
matrix:
20+
php:
21+
- 7.2
22+
- 7.3
23+
- 7.4
24+
- 8.0
25+
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v2
29+
30+
- name: Install PHP
31+
uses: shivammathur/setup-php@v2
32+
with:
33+
php-version: ${{ matrix.php }}
34+
coverage: xdebug
35+
ini-values: memory_limit=1G
36+
37+
- name: Install Composer dependencies
38+
run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader
39+
40+
- name: Tests
41+
run: vendor/bin/phpunit

.github/workflows/mariadb-10.1.yml

Lines changed: 111 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -3,58 +3,121 @@ name: MariaDB 10.1 Tests
33
on: push
44

55
jobs:
6-
test:
7-
name: |
8-
MariaDB 10.1 Tests - PHP ${{ matrix.php-versions }}
9-
${{ matrix.DB_ADAPTER }}
10-
${{ matrix.DB_PDO_PROTOCOL }}
6+
mysqli:
7+
name: MariaDB 10.1 Tests - PHP ${{ matrix.php }} mysqli
118
runs-on: ubuntu-latest
129

10+
env:
11+
DB_ADAPTER: mysqli
12+
13+
strategy:
14+
# if one of the matrix-entries break, all entries getting canceled.
15+
fail-fast: true
16+
matrix:
17+
php:
18+
- 7.2
19+
- 7.3
20+
- 7.4
21+
- 8.0
22+
23+
services:
24+
testdb:
25+
image: mariadb:10.1
26+
env:
27+
MYSQL_ROOT_PASSWORD: Pass123
28+
MYSQL_DATABASE: arc2_test
29+
MYSQL_ALLOW_EMPTY_PASSWORD: false
30+
ports:
31+
- 3306
32+
options: --health-cmd="mysqladmin ping" --health-interval=15s --health-timeout=3s --health-retries=4
33+
34+
steps:
35+
- name: Checkout
36+
uses: actions/checkout@v2
37+
38+
- name: Install PHP
39+
uses: shivammathur/setup-php@v2
40+
with:
41+
php-version: ${{ matrix.php }}
42+
coverage: xdebug
43+
ini-values: memory_limit=1G
44+
45+
- name: Install Composer dependencies
46+
run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader
47+
48+
- name: Tests
49+
run: |
50+
vendor/bin/phpunit
51+
env:
52+
DB_PORT: ${{ job.services.testdb.ports[3306] }}
53+
54+
pdo-mysql-no-cache:
55+
name: MariaDB 10.1 Tests - PHP ${{ matrix.php }} PDO mysql no cache
56+
runs-on: ubuntu-latest
57+
58+
env:
59+
DB_ADAPTER: pdo
60+
DB_PDO_PROTOCOL: mysql
61+
62+
strategy:
63+
# if one of the matrix-entries break, all entries getting canceled.
64+
fail-fast: true
65+
matrix:
66+
php:
67+
- 7.2
68+
- 7.3
69+
- 7.4
70+
- 8.0
71+
72+
services:
73+
testdb:
74+
image: mariadb:10.1
75+
env:
76+
MYSQL_ROOT_PASSWORD: Pass123
77+
MYSQL_DATABASE: arc2_test
78+
MYSQL_ALLOW_EMPTY_PASSWORD: false
79+
ports:
80+
- 3306
81+
options: --health-cmd="mysqladmin ping" --health-interval=15s --health-timeout=3s --health-retries=4
82+
83+
steps:
84+
- name: Checkout
85+
uses: actions/checkout@v2
86+
87+
- name: Install PHP
88+
uses: shivammathur/setup-php@v2
89+
with:
90+
php-version: ${{ matrix.php }}
91+
coverage: xdebug
92+
ini-values: memory_limit=1G
93+
94+
- name: Install Composer dependencies
95+
run: composer install --no-progress --no-suggest --prefer-dist --optimize-autoloader
96+
97+
- name: Tests
98+
run: |
99+
vendor/bin/phpunit
100+
env:
101+
DB_PORT: ${{ job.services.testdb.ports[3306] }}
102+
103+
pdo-mysql-cache:
104+
name: MariaDB 10.1 Tests - PHP ${{ matrix.php }} PDO mysql cache
105+
runs-on: ubuntu-latest
106+
107+
env:
108+
DB_ADAPTER: pdo
109+
DB_PDO_PROTOCOL: mysql
110+
CACHE_ENABLED: true
111+
13112
strategy:
14113
# if one of the matrix-entries break, all entries getting canceled.
15114
fail-fast: true
16115
matrix:
17-
include:
18-
# PHP 7.2
19-
- php-versions: 7.2
20-
DB_ADAPTER: mysqli
21-
- php-versions: 7.2
22-
DB_ADAPTER: pdo
23-
DB_PDO_PROTOCOL: mysql
24-
- php-versions: 7.2
25-
DB_ADAPTER: pdo
26-
DB_PDO_PROTOCOL: mysql
27-
CACHE_ENABLED: true
28-
# PHP 7.3
29-
- php-versions: 7.3
30-
DB_ADAPTER: mysqli
31-
- php-versions: 7.3
32-
DB_ADAPTER: pdo
33-
DB_PDO_PROTOCOL: mysql
34-
- php-versions: 7.3
35-
DB_ADAPTER: pdo
36-
DB_PDO_PROTOCOL: mysql
37-
CACHE_ENABLED: true
38-
# PHP 7.4
39-
- php-versions: 7.4
40-
DB_ADAPTER: mysqli
41-
- php-versions: 7.4
42-
DB_ADAPTER: pdo
43-
DB_PDO_PROTOCOL: mysql
44-
- php-versions: 7.4
45-
DB_ADAPTER: pdo
46-
DB_PDO_PROTOCOL: mysql
47-
CACHE_ENABLED: true
48-
# PHP 8.0
49-
- php-versions: 8.0
50-
DB_ADAPTER: mysqli
51-
- php-versions: 8.0
52-
DB_ADAPTER: pdo
53-
DB_PDO_PROTOCOL: mysql
54-
- php-versions: 8.0
55-
DB_ADAPTER: pdo
56-
DB_PDO_PROTOCOL: mysql
57-
CACHE_ENABLED: true
116+
php:
117+
- 7.2
118+
- 7.3
119+
- 7.4
120+
- 8.0
58121

59122
services:
60123
testdb:
@@ -74,7 +137,7 @@ jobs:
74137
- name: Install PHP
75138
uses: shivammathur/setup-php@v2
76139
with:
77-
php-version: ${{ matrix.php-versions }}
140+
php-version: ${{ matrix.php }}
78141
coverage: xdebug
79142
ini-values: memory_limit=1G
80143

@@ -83,6 +146,6 @@ jobs:
83146

84147
- name: Tests
85148
run: |
86-
vendor/bin/phpunit ${{ matrix.COVERAGE_FLAGS }}
149+
vendor/bin/phpunit
87150
env:
88151
DB_PORT: ${{ job.services.testdb.ports[3306] }}

0 commit comments

Comments
 (0)