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

[NFC] Port some recent test fixes from master to 5.28 #18053

Merged
merged 7 commits into from
Aug 4, 2020

Conversation

seamuslee001
Copy link
Contributor

eileenmcnaughton and others added 6 commits August 4, 2020 09:48
The strtotime calculation adds 4 months before setting the day of month. However

July 31 + 4 months is 1 Dec - ie the month is 12 not 11 due to there being only 30 days. So to
get 27 Nov we need to get the July month (7) and add 4 and voila 11, not 12
BY ensuring join_date is in the past we get away from situations where there is no valid status
@civibot
Copy link

civibot bot commented Aug 3, 2020

(Standard links)

@eileenmcnaughton
Copy link
Contributor

sure

Overview
--------

In recent days, api_v3_WebsiteTest has emitted sporadic failures like this:

```
api_v3_WebsiteTest::testDeleteWebsite with data set #0 (3)
Failed asserting that 3 matches expected 0.

/home/jenkins/bknix-max/build/build-2/web/sites/all/modules/civicrm/tests/phpunit/api/v3/WebsiteTest.php:75
/home/jenkins/bknix-max/build/build-2/web/sites/all/modules/civicrm/tests/phpunit/CiviTest/CiviUnitTestCase.php:209
/home/jenkins/bknix-max/extern/phpunit7/phpunit7.phar:615
```

and

```
api_v3_WebsiteTest::testDeleteWebsiteInvalid with data set #0 (3)
Failed asserting that 4 matches expected 1.

/home/jenkins/bknix-max/build/build-2/web/sites/all/modules/civicrm/tests/phpunit/api/v3/WebsiteTest.php:88
/home/jenkins/bknix-max/build/build-2/web/sites/all/modules/civicrm/tests/phpunit/CiviTest/CiviUnitTestCase.php:209
/home/jenkins/bknix-max/extern/phpunit7/phpunit7.phar:615
```

These failures do not reproduce for me in isolation.

Before
------

Both the failing assertions make an implicit assumption that the baseline content of `civicrm_website` is empty.

After
-----

The failing assertions use an explicit baseline (`$beforeCount`).

Comments
--------

The test failures are sporadic and only seem to seem occur when run in the full suite.

My theory is that something else is leaking `civicrm_website` records;
however, it's hard to track that down amidst a full suite (when the full
suite takes so long to execute).  Therefore, I cannot be certain that this
is actually fixes the problem.  However, this really just tightens up the
assumptions of the test - as long as it passes the PR tests, it should be
safe to merge and then watch in the `CiviCRM-Core-Matrix`.
@seamuslee001
Copy link
Contributor Author

Test fails unrelated

@seamuslee001 seamuslee001 merged commit 5cb039f into civicrm:5.28 Aug 4, 2020
@seamuslee001 seamuslee001 deleted the test_ports branch August 4, 2020 04:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants