catalyst / moodle-tool_dataflows

A generic workflow and processing engine which can be configured to do a large variety of tasks.
GNU General Public License v3.0
11 stars 6 forks source link

Totara 16 - php8 unit test failures - dataflows might not work as expected #569

Open keevan opened 1 year ago

keevan commented 1 year ago

It might be php8 specific, so will circle back on this

Totara 16.4 (Build: 20220826.00)
PHP: 8.0.22, pgsql: 14.0 (Debian 14.0-1.pgdg110+1), OS: Linux 5.15.0-43-generic x86_64
Started Thu, 01 Sep 2022 20:46:06 +0800

PHPUnit 9.5.23 #StandWithUkraine

Warning:       Using a custom test suite loader is deprecated

..................................................E............  63 / 135 ( 46%)
...........................................S..................F 126 / 135 ( 93%)
.FFF.....                                                       135 / 135 (100%)

Time: 00:19.461, Memory: 522.70 MB

There was 1 error:

1) tool_dataflows\tool_dataflows_flow_logic_case_test::test_flows_in_same_flow_group
TypeError: fwrite(): supplied resource is not a valid stream resource

/var/www/mysite-totara/server/admin/tool/dataflows/classes/local/step/writer_stream.php:183
/var/www/mysite-totara/server/admin/tool/dataflows/classes/local/execution/iterators/dataflow_iterator.php:89
/var/www/mysite-totara/server/admin/tool/dataflows/classes/local/execution/flow_engine_step.php:48
/var/www/mysite-totara/server/admin/tool/dataflows/classes/local/execution/engine.php:467
/var/www/mysite-totara/server/admin/tool/dataflows/classes/local/execution/engine_step.php:292
/var/www/mysite-totara/server/admin/tool/dataflows/classes/local/execution/engine_step.php:262
/var/www/mysite-totara/server/admin/tool/dataflows/classes/local/execution/engine_flow_cap.php:57
/var/www/mysite-totara/server/admin/tool/dataflows/classes/local/execution/engine.php:425
/var/www/mysite-totara/server/admin/tool/dataflows/classes/local/execution/engine.php:381
/var/www/mysite-totara/server/admin/tool/dataflows/tests/tool_dataflows_flow_logic_case_test.php:261
/var/www/mysite-totara/server/lib/phpunit/classes/testcase.php:114

--

There were 4 failures:

1) tool_dataflows\tool_dataflows_variables_test::test_parser_functions with data set #5 ('isset(a[4]["somefield"])', array(array(3, 2, 1, 2, array(1))), false)
Failed asserting that '${{isset(a[4]["somefield"])}}' matches expected false.

/var/www/mysite-totara/server/admin/tool/dataflows/tests/tool_dataflows_variables_test.php:369
/var/www/mysite-totara/server/lib/phpunit/classes/testcase.php:114

2) tool_dataflows\tool_dataflows_variables_test::test_parser_functions with data set #7 ('isset(a["e"])', array(array(null, null, stdClass Object (...))), false)
Failed asserting that '${{isset(a["e"])}}' matches expected false.

/var/www/mysite-totara/server/admin/tool/dataflows/tests/tool_dataflows_variables_test.php:369
/var/www/mysite-totara/server/lib/phpunit/classes/testcase.php:114

3) tool_dataflows\tool_dataflows_variables_test::test_parser_functions with data set #8 ('isset(a["d"].f)', array(array(null, null, stdClass Object (...))), false)
Failed asserting that '${{isset(a["d"].f)}}' matches expected false.

/var/www/mysite-totara/server/admin/tool/dataflows/tests/tool_dataflows_variables_test.php:369
/var/www/mysite-totara/server/lib/phpunit/classes/testcase.php:114

4) tool_dataflows\tool_dataflows_variables_test::test_parser_functions with data set #9 ('isset(a["something"])', array(array(3, 2, 1)), false)
Failed asserting that '${{isset(a["something"])}}' matches expected false.

/var/www/mysite-totara/server/admin/tool/dataflows/tests/tool_dataflows_variables_test.php:369
/var/www/mysite-totara/server/lib/phpunit/classes/testcase.php:114

ERRORS!
Tests: 135, Assertions: 357, Errors: 1, Failures: 4, Skipped: 1.
Engine 'case step test' status: aborted
keevan commented 1 year ago

That confirms it. Something to be wary of.

Totara 16.4 (Build: 20220826.00)
PHP: 7.4.30, pgsql: 14.0 (Debian 14.0-1.pgdg110+1), OS: Linux 5.15.0-43-generic x86_64
Started Thu, 01 Sep 2022 20:52:03 +0800

PHPUnit 9.5.23 #StandWithUkraine

Warning:       Using a custom test suite loader is deprecated

...............................................................  63 / 135 ( 46%)
...........................................S................... 126 / 135 ( 93%)
.........                                                       135 / 135 (100%)

Time: 00:18.348, Memory: 524.70 MB

OK, but incomplete, skipped, or risky tests!
Tests: 135, Assertions: 363, Skipped: 1.