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

PHP unit tests fail in 3.9 if run as a testsuite #469

Closed
dmitriim opened this issue Oct 2, 2020 · 8 comments
Closed

PHP unit tests fail in 3.9 if run as a testsuite #469

dmitriim opened this issue Oct 2, 2020 · 8 comments
Assignees
Labels

Comments

@dmitriim
Copy link
Member

dmitriim commented Oct 2, 2020

Steps to replicate:

  1. Get a vanilla 3.9
  2. Pull auth_saml2 plugin code in.
  3. php admin/tool/phpunit/cli/init.php
  4. Run core tests ./vendor/bin/phpunit --stop-on-failure --testsuite core_testsuite
  5. Get the failure

This happens because PHPMailer gets auto-loaded from auth_saml2 plugin and it has a different (higher) version to what's in core.


Time: 21.34 minutes, Memory: 297.00 MB

There was 1 failure:

1) core_moodlelib_testcase::test_email_to_user_attachment with data set "cachedir" ('/var/lib/sitedata/moodle-test/cache')
Failed asserting that 'This is a multi-part message in MIME format.\n
\n
--b1_NQnOschkfbWNggpTPMVlFmZmaXXR77vq99fKNsmqAEM\n
Content-Type: multipart/alternative;\n
 boundary="b2_NQnOschkfbWNggpTPMVlFmZmaXXR77vq99fKNsmqAEM"\n
\n
--b2_NQnOschkfbWNggpTPMVlFmZmaXXR77vq99fKNsmqAEM\n
Content-Type: text/plain; charset=UTF-8\n
Content-Transfer-Encoding: quoted-printable\n
\n
=0ATest attachment path=0A\n
--b2_NQnOschkfbWNggpTPMVlFmZmaXXR77vq99fKNsmqAEM\n
Content-Type: text/html; charset=UTF-8\n
Content-Transfer-Encoding: quoted-printable\n
\n
Test attachment path\n
\n
--b2_NQnOschkfbWNggpTPMVlFmZmaXXR77vq99fKNsmqAEM--\n
\n
--b1_NQnOschkfbWNggpTPMVlFmZmaXXR77vq99fKNsmqAEM\n
Content-Type: text/plain; name=hello.txt\n
Content-Transfer-Encoding: base64\n
Content-Disposition: attachment; filename=hello.txt\n
\n
SGVsbG8=\n
\n
--b1_NQnOschkfbWNggpTPMVlFmZmaXXR77vq99fKNsmqAEM--\n
' contains "Content-Type: text/plain; name="hello.txt"".

/var/www/project/moodle/lib/tests/moodlelib_test.php:111
/var/www/project/moodle/lib/phpunit/classes/advanced_testcase.php:80

To re-run:
 vendor/bin/phpunit "core_moodlelib_testcase" lib/tests/moodlelib_test.php

FAILURES!
Tests: 2069, Assertions: 39356, Failures: 1, Skipped: 2.
@dmitriim dmitriim added the bug label Oct 2, 2020
@dmitriim dmitriim changed the title PHP unit tests fail in 3.9 if run as a suit PHP unit tests fail in 3.9 if run as a testsuite Oct 2, 2020
@dmitriim dmitriim self-assigned this Oct 2, 2020
@dmitriim dmitriim closed this as completed Oct 6, 2020
@Anupamatd Anupamatd reopened this Sep 29, 2021
@Anupamatd
Copy link
Contributor

Hi,

This PHP unit tests fail came again due to recent update simplesamlphp to 1.19.1 with below commit:
d0dfa3b

Thanks,
Anu

@dmitriim
Copy link
Member Author

@Anupamatd this was the fix 1c40898

@Anupamatd
Copy link
Contributor

Thank you @dmitriim - will try this 1c40898.
I thought this was the fix 6285e03

@dmitriim
Copy link
Member Author

Oh. Maybe you are right. Or maybe both?

@Anupamatd
Copy link
Contributor

Hey @dmitriim - This fix (6285e03) fixed issue in my local

Do i need to also remove composer files from compiled extlib/simplesamlphp (1c40898)?

@dmitriim
Copy link
Member Author

I'd recommend it.

@Anupamatd
Copy link
Contributor

Thank you @dmitriim - will remove that.

@Anupamatd
Copy link
Contributor

Hey @dmitriim - Created a PR - #611
Please review and merge.
Thank you.

daledavies pushed a commit to sarahjcotton/moodle-auth_saml2 that referenced this issue Aug 17, 2023
sarahjcotton pushed a commit to sarahjcotton/moodle-auth_saml2 that referenced this issue Aug 24, 2023
sarahjcotton pushed a commit to sarahjcotton/moodle-auth_saml2 that referenced this issue Sep 15, 2023
sarahjcotton pushed a commit to sarahjcotton/moodle-auth_saml2 that referenced this issue Sep 15, 2023
sarahjcotton pushed a commit to sarahjcotton/moodle-auth_saml2 that referenced this issue Oct 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants