Skip to content

Load PHPunit app tests in alphabetical order#35665

Merged
DeepDiver1975 merged 1 commit into
masterfrom
load-phpunit-app-tests-alphabetical
Jun 26, 2019
Merged

Load PHPunit app tests in alphabetical order#35665
DeepDiver1975 merged 1 commit into
masterfrom
load-phpunit-app-tests-alphabetical

Conversation

@phil-davis

Copy link
Copy Markdown
Contributor

Description

When finding the unit tests for the built-in core apps, use scandir() so that the relevant folders and files are discovered and loaded in a predictable order - in this case it will be alphabetical order.

At least this will mean that the unit test runs will more reliably either pass or fail. There will not be the potential for "random" failures due to the order of test case execution.

Related Issue

#35658

Motivation and Context

We are getting intermittent unit test fails in CI. Actually those fails are because apps/files_sharing/tests/External/ManagerTest.php testAddShareAccepted is not cleaning up the share that it creates.

If that happens to run before apps/files_sharing/tests/Commands/CleanupRemoteStoragesTest then CleanupRemoteStoragesTest fails because its environment starts out with an extra unexepected entry in share_external table.

apps/files_sharing/tests/External/ManagerTest.php can be fixed in a separate PR.

How Has This Been Tested?

CI

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Database schema changes (next release will require increase of minor version instead of patch)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation ticket raised:

Open tasks:

  • Backport (if applicable set "backport-request" label and remove when the backport was done)

@phil-davis

Copy link
Copy Markdown
Contributor Author

CI has got some of the out-of-memory errors that we have also been getting the last few days.
https://drone.owncloud.com/owncloud/core/18859/175
https://drone.owncloud.com/owncloud/core/18859/279

I will restart and see if we can get lucky with those.

@phil-davis

phil-davis commented Jun 26, 2019

Copy link
Copy Markdown
Contributor Author

drone is happy - great!
codecov status did not come - no problem, somebody can override and merge this if it is approved.

@DeepDiver1975
DeepDiver1975 merged commit 0edcdbc into master Jun 26, 2019
@delete-merged-branch
delete-merged-branch Bot deleted the load-phpunit-app-tests-alphabetical branch June 26, 2019 07:16
@phil-davis

Copy link
Copy Markdown
Contributor Author

Backport stable10 #35669

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.

2 participants