catalyst / moodle-auth_outage

Planned, graduated user and admin friendly moodle outages
https://moodle.org/plugins/auth_outage
17 stars 33 forks source link

Unit tests failing on Moodle 3.9 #236

Closed christina-roperto closed 3 months ago

christina-roperto commented 3 years ago

There are 12 tests failed when I ran unit test:


Moodle 3.9.4+ (Build: 20210130),
Php: 7.2.34.9.20.04.1.1, mariadb: 10.3.25, OS: Linux 5.8.0-41-generic x86_64
PHPUnit 7.5.20 by Sebastian Bergmann and contributors.

This test did not perform any assertions

/var/www/moodle.test/html/auth/outage/tests/phpunit/dml/outagedb_test.php:90

This test did not perform any assertions

/var/www/moodle.test/html/auth/outage/tests/phpunit/form/forms_test.php:46

This test did not perform any assertions

/var/www/moodle.test/html/auth/outage/tests/phpunit/form/forms_test.php:53

This test did not perform any assertions

/var/www/moodle.test/html/auth/outage/tests/phpunit/form/forms_test.php:156

This test did not perform any assertions

/var/www/moodle.test/html/auth/outage/tests/phpunit/local/cli/cli_test.php:62

This test did not perform any assertions

/var/www/moodle.test/html/auth/outage/tests/phpunit/local/cli/finish_test.php:113

This test did not perform any assertions

/var/www/moodle.test/html/auth/outage/tests/phpunit/local/controllers/infopage_test.php:45

This test did not perform any assertions

/var/www/moodle.test/html/auth/outage/tests/phpunit/local/controllers/infopage_test.php:52

This test did not perform any assertions

/var/www/moodle.test/html/auth/outage/tests/phpunit/local/controllers/maintenance_static_page_test.php:62

This test did not perform any assertions

/var/www/moodle.test/html/auth/outage/tests/phpunit/local/controllers/maintenance_static_page_test.php:396

This test did not perform any assertions

/var/www/moodle.test/html/auth/outage/tests/phpunit/local/controllers/maintenance_static_page_test.php:415

This test did not perform any assertions

/var/www/moodle.test/html/auth/outage/tests/phpunit/local/outagelib_test.php:188
ScottVerbeek commented 3 years ago

I've had failing unit a failing unit test on Moodle 3.9

There was 1 failure:

1) outagelib_test::test_inject
Failed asserting that 668 is identical to 4781.

/var/www/site/auth/outage/tests/phpunit/local/outagelib_test.php:107
/var/www/site/lib/phpunit/classes/advanced_testcase.php:80

To re-run:
 vendor/bin/phpunit "outagelib_test" auth/outage/tests/phpunit/local/outagelib_test.php

I've tracked it down to these two lines: https://github.com/catalyst/moodle-auth_outage/blob/master/tests/phpunit/local/outagelib_test.php#L106-L107

The first time $OUTPUT->standard_top_of_body_html() it produces this https://paste.wgtn.cat-it.co.nz/QpFcrfzP18Z0lv5E#SpBoTvrLE5k2kbDHP203IQ$0 The second time The first time $OUTPUT->standard_top_of_body_html() is called the outage bar no longer is in the output see https://paste.wgtn.cat-it.co.nz/D7AYLemvDBt5KT9G#y9c/E506phLmfS8AQFUJeA$0

ScottVerbeek commented 3 years ago

Note this happens when the plugin https://github.com/catalyst/moodle-local_envbar is installed as well

ScottVerbeek commented 3 years ago

The issues I had with unit test have been resolved in Pull request #237