Skip to content

Conversation

shmax
Copy link
Contributor

@shmax shmax commented Sep 19, 2023

With this change, the CI now iterates over each of the supported connection types (mysql, sqlite, and pgsql) and runs the entire test suite.

The adapter test cases will skip if they don't match with the connection type (so that we don't needlessly run them 3 times).

Had to fix tons of little problems to get this all working.

I also modified DatabaseTestCase so that it now only tears down the test database at when beginning each class, as opposed to each test. This speeds things up quite a bit, but opens us up to little issues (eg. adding a record in test A can throw off test B that doesn't expect it to exist), so I may have to undo that at some point if it becomes a major annoyance.

@codecov
Copy link

codecov bot commented Sep 19, 2023

Codecov Report

Merging #88 (d02450c) into master (aa3f07d) will increase coverage by 0.48%.
The diff coverage is 100.00%.

@@             Coverage Diff              @@
##             master      #88      +/-   ##
============================================
+ Coverage     96.91%   97.40%   +0.48%     
- Complexity      968      975       +7     
============================================
  Files            33       34       +1     
  Lines          2367     2386      +19     
============================================
+ Hits           2294     2324      +30     
+ Misses           73       62      -11     
Files Changed Coverage Δ
lib/Column.php 94.59% <ø> (ø)
lib/Adapter/MysqlAdapter.php 100.00% <100.00%> (ø)
lib/Adapter/PgsqlAdapter.php 100.00% <100.00%> (+4.08%) ⬆️
lib/Adapter/SqliteAdapter.php 95.45% <100.00%> (+4.75%) ⬆️
lib/Connection.php 92.69% <100.00%> (+1.02%) ⬆️
lib/Exception/DatabaseException.php 100.00% <100.00%> (ø)
lib/Model.php 99.54% <100.00%> (+0.91%) ⬆️
lib/Relation.php 100.00% <100.00%> (ø)
lib/SQLBuilder.php 100.00% <100.00%> (+2.61%) ⬆️
lib/Table.php 99.06% <100.00%> (+0.46%) ⬆️
... and 1 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@shmax
Copy link
Contributor Author

shmax commented Sep 19, 2023

About what I was afraid of...

..F....................E.................E.....................  63 / 789 (  7%)
.................E............EEFE.E...F...........FF.......... 126 / 789 ( 15%)
......EFEE.EE....EEEEE..E.EEE.E.EEEE..EEEE.EE...EEEEEEEE.EEFEE. [18](https://github.com/php-activerecord/activerecord/actions/runs/6231683665/job/16913582298?pr=88#step:10:19)9 / 789 ( [23](https://github.com/php-activerecord/activerecord/actions/runs/6231683665/job/16913582298?pr=88#step:10:24)%)
...........EEEEE...EEEE..E...EE...SFFE..SEE....E..............E [25](https://github.com/php-activerecord/activerecord/actions/runs/6231683665/job/16913582298?pr=88#step:10:26)2 / 789 ( 31%)
........................EE.................................F... 315 / 789 ( 39%)
.......EE................EEE...E..........EEEEEEEE............. 378 / 789 ( 47%)
............................................................... 441 / 789 ( 55%)
........................EE..EE.....E.F.........E.......EE.EE... 504 / 789 ( 63%)
..........................E............E........F.............. 567 / 789 ( 71%)
....S.....S....................E............................... 630 / 789 ( 79%)
.............................................EEEEEEEEEEEEEEEEEE 693 / 789 ( 87%)
EEEEEEEEEEEEEEEEEEEFFEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE.EEEE. 756 / 789 ( 95%)
EEE.................F.........FFF                               789 / 789 (100%)

@shmax
Copy link
Contributor Author

shmax commented Sep 21, 2023

Well, the good news is that I managed to speed up the tests by a factor of 5, but the bad news is that a lot of the tests that pass on local are failing in the CI. Sigh.

@shmax shmax merged commit 23e4070 into master Sep 23, 2023
@shmax shmax deleted the db-matrix branch September 23, 2023 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant