Skip to content

Fix unit test of RecreateMasterKey#34678

Merged
phil-davis merged 1 commit into
stable10from
fix-encryption-unittest
Mar 5, 2019
Merged

Fix unit test of RecreateMasterKey#34678
phil-davis merged 1 commit into
stable10from
fix-encryption-unittest

Conversation

@sharidas

@sharidas sharidas commented Mar 5, 2019

Copy link
Copy Markdown
Contributor

The unit test of RecreateMasterKey were
failing because the indexes pointed for
writeln method were not matching. This
patch fixes the same.

Signed-off-by: Sujith H sharidasan@owncloud.com

Description

The unit test did pass in owncloud/encryption#21. But it has been observed recently the failure in drone, regarding the failure:

1) OCA\Encryption\Tests\Command\RecreateMasterKeyTest::testNewMasterKey with data set #0 (true)
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-Encryption completed successfully
+<info>Note: All users are required to relogin.</info>

/home/sujith/test/owncloud/apps/encryption/tests/Command/RecreateMasterKeyTest.php:216

FAILURES!
Tests: 2, Assertions: 4, Failures: 1.

This is because of the wrong index of writeln method. I have updated the changes and verified it in my instance. And this should fix it.

Related Issue

  • Fixes <issue_link>

Motivation and Context

Fix the unit test failure for RecreateMasterKey.

How Has This Been Tested?

  • Ran the unit test in my instance:
/home/sujith/test/owncloud/lib/composer/phpunit/phpunit/phpunit --configuration phpunit-autotest.xml --coverage-clover autotest-clover-mysql.xml --coverage-html coverage-html-mysql --log-junit autotest-results-mysql.xml ../apps/encryption/tests/Command/RecreateMasterKeyTest.php 
Cannot load Xdebug - it was already loaded
PHPUnit 5.7.27 by Sebastian Bergmann and contributors.

Runtime:       PHP 7.2.15-1+ubuntu18.04.1+deb.sury.org+1 with Xdebug 2.6.1
Configuration: /home/sujith/test/owncloud/tests/phpunit-autotest.xml

..                                                                  2 / 2 (100%)

Time: 5.17 seconds, Memory: 40.00MB

OK (2 tests, 7 assertions)

Screenshots (if appropriate):

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)

@sharidas sharidas added this to the development milestone Mar 5, 2019
@sharidas sharidas self-assigned this Mar 5, 2019
@sharidas
sharidas requested a review from individual-it March 5, 2019 06:24
The unit test of RecreateMasterKey were
failing because the indexes pointed for
writeln method were not matching. This
patch fixes the same.

Signed-off-by: Sujith H <sharidasan@owncloud.com>
@sharidas
sharidas force-pushed the fix-encryption-unittest branch from a952403 to 3e09d96 Compare March 5, 2019 07:40
@codecov

codecov Bot commented Mar 5, 2019

Copy link
Copy Markdown

Codecov Report

Merging #34678 into stable10 will decrease coverage by 18.97%.
The diff coverage is n/a.

Impacted file tree graph

@@               Coverage Diff               @@
##             stable10   #34678       +/-   ##
===============================================
- Coverage          64%   45.03%   -18.98%     
===============================================
  Files            1276      116     -1160     
  Lines           75801    11465    -64336     
  Branches         1291     1291               
===============================================
- Hits            48515     5163    -43352     
+ Misses          26907     5923    -20984     
  Partials          379      379
Flag Coverage Δ Complexity Δ
#javascript 53.22% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit 30.64% <ø> (-34.51%) 0 <ø> (-19247)
Impacted Files Coverage Δ Complexity Δ
lib/private/Files/Storage/DAV.php 59.45% <0%> (-21.64%) 0% <0%> (ø)
apps/updatenotification/templates/admin.php
lib/private/Encryption/Keys/Storage.php
lib/private/App/CodeChecker/NodeVisitor.php
lib/private/RedisFactory.php
apps/dav/lib/Avatars/AvatarNode.php
...s/dav/appinfo/Migrations/Version20170202213905.php
apps/dav/lib/Upload/ChunkLocationProvider.php
apps/files/lib/AppInfo/Application.php
apps/systemtags/list.php
... and 1152 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 811dc02...3e09d96. Read the comment docs.

@codecov

codecov Bot commented Mar 5, 2019

Copy link
Copy Markdown

Codecov Report

Merging #34678 into stable10 will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff             @@
##             stable10   #34678   +/-   ##
===========================================
  Coverage          64%      64%           
  Complexity      19247    19247           
===========================================
  Files            1276     1276           
  Lines           75801    75801           
  Branches         1291     1291           
===========================================
  Hits            48515    48515           
  Misses          26907    26907           
  Partials          379      379
Flag Coverage Δ Complexity Δ
#javascript 53.22% <ø> (ø) 0 <ø> (ø) ⬇️
#phpunit 65.15% <ø> (ø) 19247 <ø> (ø) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 811dc02...3e09d96. Read the comment docs.

@phil-davis
phil-davis merged commit 80b1356 into stable10 Mar 5, 2019
@delete-merged-branch
delete-merged-branch Bot deleted the fix-encryption-unittest branch March 5, 2019 09:03
@phil-davis

Copy link
Copy Markdown
Contributor

"forward port" fix for master is in separate encryption app PR owncloud/encryption#107

@lock lock Bot locked as resolved and limited conversation to collaborators Mar 10, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants