Skip to content

Commit 4b8cf2b

Browse files
authored
Moved FlowIntegrationTestCase to the same namespace as FlowTestCase (#1305)
* Moved FlowIntegrationTestCase to the same namespace as FlowTestCase * Hardcoded branch name * Replaced action used to download artifact * Fixed reading artifact content
1 parent 945ecd9 commit 4b8cf2b

File tree

32 files changed

+45
-45
lines changed

32 files changed

+45
-45
lines changed

.github/workflows/test-suite.yml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -249,23 +249,17 @@ jobs:
249249
- name: "Test - Examples"
250250
run: "composer test:examples"
251251

252-
- name: Get the source branch of the PR
252+
- name: "Download artifact"
253253
if: ${{ github.event_name == 'pull_request' && matrix.php-version == '8.2' && matrix.dependencies == 'locked' }}
254-
run: |
255-
pr_source_branch=${{ github.event.pull_request.head.ref }}
256-
echo "Source branch of the PR: $pr_source_branch"
257-
echo "pr_source_branch=$pr_source_branch" >> $GITHUB_ENV
258-
259-
- name: Download artifact
260-
if: ${{ github.event_name == 'pull_request' && matrix.php-version == '8.2' && matrix.dependencies == 'locked' }}
261-
uses: actions/download-artifact@v3
254+
uses: dawidd6/action-download-artifact@v7
262255
with:
263-
name: "codecov-base-commit-sha-${{ env.pr_source_branch }}"
256+
workflow: test-suite.yml
257+
name: codecov-base-commit-sha-1.x
264258

265259
- name: Read artifact content into variable
266260
if: ${{ github.event_name == 'pull_request' && matrix.php-version == '8.2' && matrix.dependencies == 'locked' }}
267261
run: |
268-
ARTIFACT_CONTENT=$(cat codecov-base-commit-sha-${{ env.pr_source_branch }}) # Read artifact content
262+
ARTIFACT_CONTENT=$(cat codecov-base-commit-sha-1.x.txt)
269263
echo "codecov_base_commit_sha=$ARTIFACT_CONTENT" >> $GITHUB_ENV
270264
271265
- name: Upload test results to Codecov.io for baseline

src/adapter/etl-adapter-csv/tests/Flow/ETL/Adapter/CSV/Tests/Integration/CSVDetectorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@
55
namespace Flow\ETL\Adapter\CSV\Tests\Integration;
66

77
use Flow\ETL\Adapter\CSV\CSVDetector;
8+
use Flow\ETL\Tests\FlowTestCase;
89
use Flow\Filesystem\SourceStream;
910
use Flow\Filesystem\Stream\MemorySourceStream;
1011
use PHPUnit\Framework\Attributes\DataProvider;
11-
use PHPUnit\Framework\TestCase;
1212

13-
final class CSVDetectorTest extends TestCase
13+
final class CSVDetectorTest extends FlowTestCase
1414
{
1515
public static function enclosure_provider() : \Generator
1616
{

src/adapter/etl-adapter-csv/tests/Flow/ETL/Adapter/CSV/Tests/Integration/CSVExtractorTest.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@
88
use function Flow\ETL\DSL\{df, print_schema, ref};
99
use Flow\ETL\Adapter\CSV\CSVExtractor;
1010
use Flow\ETL\Extractor\Signal;
11-
use Flow\ETL\{Config, FlowContext, Row, Rows};
11+
use Flow\ETL\{Config, FlowContext, Row, Rows, Tests\FlowTestCase};
1212
use Flow\Filesystem\Path;
13-
use PHPUnit\Framework\TestCase;
1413

15-
final class CSVExtractorTest extends TestCase
14+
final class CSVExtractorTest extends FlowTestCase
1615
{
1716
public function test_extracting_csv_empty_columns_as_empty_strings() : void
1817
{

src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Integration/Loader/XMLLoaderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use function Flow\ETL\Adapter\XML\{from_xml, to_xml};
88
use function Flow\ETL\DSL\{df, from_array, overwrite, ref};
99
use Flow\ETL\Tests\Double\FakeExtractor;
10-
use Flow\ETL\Tests\Integration\FlowIntegrationTestCase;
10+
use Flow\ETL\Tests\FlowIntegrationTestCase;
1111

1212
final class XMLLoaderTest extends FlowIntegrationTestCase
1313
{

src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Integration/XMLParserExtractorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
Flow,
1313
FlowContext,
1414
PHP\Type\Caster,
15-
Tests\Integration\FlowIntegrationTestCase};
15+
Tests\FlowIntegrationTestCase};
1616
use Flow\Filesystem\Path;
1717

1818
final class XMLParserExtractorTest extends FlowIntegrationTestCase

src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Integration/XMLReaderExtractorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use function Flow\ETL\DSL\type_string;
88
use Flow\ETL\Adapter\XML\XMLReaderExtractor;
99
use Flow\ETL\Extractor\Signal;
10-
use Flow\ETL\{Config, Flow, FlowContext, PHP\Type\Caster, Tests\Integration\FlowIntegrationTestCase};
10+
use Flow\ETL\{Config, Flow, FlowContext, PHP\Type\Caster, Tests\FlowIntegrationTestCase};
1111
use Flow\Filesystem\Path;
1212

1313
final class XMLReaderExtractorTest extends FlowIntegrationTestCase

src/adapter/etl-adapter-xml/tests/Flow/ETL/Adapter/XML/Tests/Integration/XMLTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
use function Flow\ETL\Adapter\XML\from_xml;
88
use function Flow\ETL\DSL\{datetime_schema, df, int_schema, ref, schema, type_int};
99
use function Flow\Filesystem\DSL\path;
10-
use Flow\ETL\Tests\Integration\FlowIntegrationTestCase;
10+
use Flow\ETL\Tests\FlowIntegrationTestCase;
1111

1212
final class XMLTest extends FlowIntegrationTestCase
1313
{

src/bridge/filesystem/async-aws/tests/Flow/Filesystem/Bridge/AsyncAWS/Tests/Integration/AsyncAWSS3TestCase.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
use function Flow\Filesystem\Bridge\AsyncAWS\DSL\aws_s3_client;
88
use AsyncAws\S3\S3Client;
9-
use Flow\ETL\Tests\Integration\FlowIntegrationTestCase;
9+
use Flow\ETL\Tests\FlowIntegrationTestCase;
1010
use Flow\Filesystem\Path;
1111

1212
abstract class AsyncAWSS3TestCase extends FlowIntegrationTestCase

src/core/etl/tests/Flow/ETL/Tests/Integration/FlowIntegrationTestCase.php renamed to src/core/etl/tests/Flow/ETL/Tests/FlowIntegrationTestCase.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@
22

33
declare(strict_types=1);
44

5-
namespace Flow\ETL\Tests\Integration;
5+
namespace Flow\ETL\Tests;
66

7-
use Flow\ETL\{Config\Cache\CacheConfig, Tests\FlowTestCase};
7+
use Flow\ETL\{Config\Cache\CacheConfig};
88
use Flow\Filesystem\{Filesystem, Path};
99
use Flow\Filesystem\{FilesystemTable, Local\NativeLocalFilesystem, Local\StdOutFilesystem};
1010
use Flow\Serializer\{Base64Serializer, NativePHPSerializer, Serializer};
1111

12+
/**
13+
* Test case for integration tests.
14+
*/
1215
abstract class FlowIntegrationTestCase extends FlowTestCase
1316
{
1417
protected Path $cacheDir;

src/core/etl/tests/Flow/ETL/Tests/FlowTestCase.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
use Flow\ETL\{Extractor, FlowContext, Rows};
99
use PHPUnit\Framework\TestCase;
1010

11+
/**
12+
* Base test case for testing FLow, designed mostly for unit tests.
13+
* In case of integration tests, use FlowIntegrationTestCase that extends this class.
14+
*/
1115
abstract class FlowTestCase extends TestCase
1216
{
1317
final public static function assertExtractedBatchesCount(

0 commit comments

Comments
 (0)