Bug #81277

Import tests with side effects

Added by Oliver Hader over 2 years ago. Updated almost 2 years ago.

Status:
Accepted
Priority:
Should have
Assignee:
-
Category:
Tests
Target version:
-
Start date:
2017-05-19
Due date:
% Done:

0%

TYPO3 Version:
9
PHP Version:
Tags:
tests
Complexity:
Is Regression:
Sprint Focus:

Description

Calling test case TYPO3\CMS\Impexp\Tests\Functional\Import\PagesAndTtContentWithImages\ImportInFilledDatabaseTest::importPagesAndRelatedTtContentWithDifferentImageToExistingData multiple times has negative side effects. The first execution is fine, the second execution fails. I did not analyze further tests in that regard, however would expect that test cases take care of cleaning up artifacts during the tear-down phase.

First execution (all fine)

 olly@oliver  ip9.local  ./allTest.sh --filter=importPagesAndRelatedTtContentWithDifferentImageToExistingData
PHPUnit 5.7.5 by Sebastian Bergmann and contributors.

Starting test 'TYPO3\CMS\Impexp\Tests\Functional\Import\PagesAndTtContentWithImages\ImportInFilledDatabaseTest::importPagesAndRelatedTtContentWithDifferentImageToExistingData'.
.                                                                   1 / 1 (100%)

Time: 3.43 seconds, Memory: 20.00MB

OK (1 test, 24 assertions)

Second execution (fails)

 olly@oliver  ip9.local  ./allTest.sh --filter=importPagesAndRelatedTtContentWithDifferentImageToExistingData
PHPUnit 5.7.5 by Sebastian Bergmann and contributors.

Starting test 'TYPO3\CMS\Impexp\Tests\Functional\Import\PagesAndTtContentWithImages\ImportInFilledDatabaseTest::importPagesAndRelatedTtContentWithDifferentImageToExistingData'.
F                                                                   1 / 1 (100%)

Time: 2.32 seconds, Memory: 20.00MB

There was 1 failure:

1) TYPO3\CMS\Impexp\Tests\Functional\Import\PagesAndTtContentWithImages\ImportInFilledDatabaseTest::importPagesAndRelatedTtContentWithDifferentImageToExistingData
Record "sys_file:4" not found in database
Assertion in data-set failed for "sys_file_reference:2":
Fields   |Assertion|Record
uid_local|4        |1

Assertion in data-set failed for "sys_file_metadata:1":
Fields     |Assertion             |Record
title      |Dummy image           |NULL
description|This is a dummy image.|NULL
alternative|Photo of program code |NULL

Record "sys_file_metadata:3" not found in database

/Users/olly/Development/typo3/master/vendor/typo3/testing-framework/Classes/Core/Functional/FunctionalTestCase.php:443
/Users/olly/Development/typo3/master/typo3/sysext/core/Tests/Functional/DataHandling/AbstractDataHandlerActionTestCase.php:118
/Users/olly/Development/typo3/master/typo3/sysext/impexp/Tests/Functional/Import/PagesAndTtContentWithImages/ImportInFilledDatabaseTest.php:60

FAILURES!
Tests: 1, Assertions: 14, Failures: 1.

Related issues

Related to TYPO3 Core - Task #55532: Impexp: import the binary files being sys_file records to the right storage Closed 2014-01-31
Related to TYPO3 Core - Task #59731: Cleanup created files in functional test in impexp Closed 2014-06-20

History

#1 Updated by Oliver Hader over 2 years ago

  • Description updated (diff)

#2 Updated by Oliver Hader over 2 years ago

  • Related to Task #55532: Impexp: import the binary files being sys_file records to the right storage added

#3 Updated by Oliver Hader over 2 years ago

  • Related to Task #59731: Cleanup created files in functional test in impexp added

#4 Updated by Susanne Moog almost 2 years ago

  • Status changed from New to Accepted
  • Tags set to tests

Also available in: Atom PDF