Skip to content

[Tests-Only] Files external php unit tests - #38354

Merged
phil-davis merged 3 commits into
masterfrom
filesExternalPhpUnitTest
May 13, 2021
Merged

phil-davis merged 3 commits into
masterfrom
filesExternalPhpUnitTest

Conversation

@kiranparajuli589

@kiranparajuli589 kiranparajuli589 commented Jan 27, 2021 •

Copy link
Copy Markdown
Contributor

Description

Runs files external "owncloud" tests on drone

Related Issue

Motivation and Context

Better test coverage

How Has This Been Tested?

  • 🤖

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:
  • Changelog item, see TEMPLATE

@kiranparajuli589
kiranparajuli589 marked this pull request as draft January 27, 2021 18:34
@kiranparajuli589
kiranparajuli589 force-pushed the filesExternalPhpUnitTest branch 9 times, most recently from 9ce6e59 to b50eec6 Compare January 27, 2021 19:07
@kiranparajuli589
kiranparajuli589 force-pushed the filesExternalPhpUnitTest branch 15 times, most recently from 12be840 to 6fb8d9a Compare February 15, 2021 06:43
@kiranparajuli589
kiranparajuli589 force-pushed the filesExternalPhpUnitTest branch 5 times, most recently from d7df146 to 72573c2 Compare February 15, 2021 10:25
@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@dpakach dpakach left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kiranparajuli589
kiranparajuli589 force-pushed the filesExternalPhpUnitTest branch 3 times, most recently from 48e5d86 to d10bc5b Compare April 13, 2021 10:47
@kiranparajuli589
kiranparajuli589 force-pushed the filesExternalPhpUnitTest branch 7 times, most recently from 9cda2ff to feee46b Compare April 28, 2021 06:44
@kiranparajuli589

Copy link
Copy Markdown
Contributor Author

at the date of the comment...blocked because docker owncloud/server is not working properly.

@kiranparajuli589
kiranparajuli589 force-pushed the filesExternalPhpUnitTest branch 3 times, most recently from 5bea701 to e359e5a Compare May 12, 2021 06:12
@phil-davis

Copy link
Copy Markdown
Contributor

https://drone.owncloud.com/owncloud/core/30001/34/11

PHPUnit 8.5.15 by Sebastian Bergmann and contributors.

Runtime:       PHP 7.2.34-21+ubuntu18.04.1+deb.sury.org+1
Configuration: /drone/src/tests/phpunit-autotest.xml
Error:         No code coverage driver is available

.............................................F................... 65 / 85 ( 76%)
....................                                              85 / 85 (100%)

Time: 2.21 minutes, Memory: 28.00 MB

There was 1 failure:

1) OCA\Files_External\Tests\Storage\OwncloudTest::testCheckUpdate
No update
Failed asserting that true is false.

/drone/src/tests/lib/Files/Storage/Storage.php:347

This looks like a real fail to me.

	public function testCheckUpdate() {
		if ($this->instance instanceof \OC\Files\Storage\Wrapper\Wrapper) {
			$this->markTestSkipped('Cannot test update check on wrappers');
		}
		$textFile = \OC::$SERVERROOT . '/tests/data/lorem.txt';
		$watcher = $this->instance->getWatcher();
		$watcher->setPolicy(Watcher::CHECK_ALWAYS);
		$this->instance->file_put_contents('/lorem.txt', \file_get_contents($textFile));
		$this->assertTrue($watcher->checkUpdate('/lorem.txt'), 'Update detected');
		$this->assertFalse($watcher->checkUpdate('/lorem.txt'), 'No update');
	}

checkUpdate is supposed to check the local cache and if it is new/changed then update the storage. A second call to checkUpdate should find that no update is needed.

@phil-davis

Copy link
Copy Markdown
Contributor

https://drone.owncloud.com/owncloud/core/30013/31/10
It needs tests/drone/configs/config.files_external.owncloud.php to be created. That seems to be called config.files_external_owncloud.php at the moment.

@kiranparajuli589

Copy link
Copy Markdown
Contributor Author

https://drone.owncloud.com/owncloud/core/30001/34/11

PHPUnit 8.5.15 by Sebastian Bergmann and contributors.

Runtime:       PHP 7.2.34-21+ubuntu18.04.1+deb.sury.org+1
Configuration: /drone/src/tests/phpunit-autotest.xml
Error:         No code coverage driver is available

.............................................F................... 65 / 85 ( 76%)
....................                                              85 / 85 (100%)

Time: 2.21 minutes, Memory: 28.00 MB

There was 1 failure:

1) OCA\Files_External\Tests\Storage\OwncloudTest::testCheckUpdate
No update
Failed asserting that true is false.

/drone/src/tests/lib/Files/Storage/Storage.php:347

This looks like a real fail to me.

	public function testCheckUpdate() {
		if ($this->instance instanceof \OC\Files\Storage\Wrapper\Wrapper) {
			$this->markTestSkipped('Cannot test update check on wrappers');
		}
		$textFile = \OC::$SERVERROOT . '/tests/data/lorem.txt';
		$watcher = $this->instance->getWatcher();
		$watcher->setPolicy(Watcher::CHECK_ALWAYS);
		$this->instance->file_put_contents('/lorem.txt', \file_get_contents($textFile));
		$this->assertTrue($watcher->checkUpdate('/lorem.txt'), 'Update detected');
		$this->assertFalse($watcher->checkUpdate('/lorem.txt'), 'No update');
	}

checkUpdate is supposed to check the local cache and if it is new/changed then update the storage. A second call to checkUpdate should find that no update is needed.

@phil-davis we can skip this with a new issue

@phil-davis

phil-davis commented May 13, 2021 •

Copy link
Copy Markdown
Contributor

we can skip this with a new issue

I created issue #38731 and pushed some code that should skip the test.

@phil-davis

Copy link
Copy Markdown
Contributor

https://drone.owncloud.com/owncloud/core/30022/31/10

PHPUnit 8.5.15 by Sebastian Bergmann and contributors.

Runtime:       PHPDBG 7.2.34-21+ubuntu18.04.1+deb.sury.org+1
Configuration: /drone/src/tests/phpunit-autotest-external.xml

.............................................S................... 65 / 85 ( 76%)
....................                                              85 / 85 (100%)

Time: 2.01 minutes, Memory: 52.52 MB

There was 1 skipped test:

1) OCA\Files_External\Tests\Storage\OwncloudTest::testCheckUpdate
Skip testCheckUpdate on OwncloudTest see issue 38371

/drone/src/tests/lib/Files/Storage/Storage.php:343

OK, but incomplete, skipped, or risky tests!
Tests: 85, Assertions: 364, Skipped: 1.

Looks good - the test is skipped.

@sonarqubecloud

Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Run files_external tests in Drone

4 participants