Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moved FlowIntegrationTestCase to the same namespace as FlowTestCase #1305

Merged
merged 4 commits into from
Dec 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions .github/workflows/test-suite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -249,23 +249,17 @@ jobs:
- name: "Test - Examples"
run: "composer test:examples"

- name: Get the source branch of the PR
- name: "Download artifact"
if: ${{ github.event_name == 'pull_request' && matrix.php-version == '8.2' && matrix.dependencies == 'locked' }}
run: |
pr_source_branch=${{ github.event.pull_request.head.ref }}
echo "Source branch of the PR: $pr_source_branch"
echo "pr_source_branch=$pr_source_branch" >> $GITHUB_ENV

- name: Download artifact
if: ${{ github.event_name == 'pull_request' && matrix.php-version == '8.2' && matrix.dependencies == 'locked' }}
uses: actions/download-artifact@v3
uses: dawidd6/action-download-artifact@v7
with:
name: "codecov-base-commit-sha-${{ env.pr_source_branch }}"
workflow: test-suite.yml
name: codecov-base-commit-sha-1.x

- name: Read artifact content into variable
if: ${{ github.event_name == 'pull_request' && matrix.php-version == '8.2' && matrix.dependencies == 'locked' }}
run: |
ARTIFACT_CONTENT=$(cat codecov-base-commit-sha-${{ env.pr_source_branch }}) # Read artifact content
ARTIFACT_CONTENT=$(cat codecov-base-commit-sha-1.x.txt)
echo "codecov_base_commit_sha=$ARTIFACT_CONTENT" >> $GITHUB_ENV

- name: Upload test results to Codecov.io for baseline
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
namespace Flow\ETL\Adapter\CSV\Tests\Integration;

use Flow\ETL\Adapter\CSV\CSVDetector;
use Flow\ETL\Tests\FlowTestCase;
use Flow\Filesystem\SourceStream;
use Flow\Filesystem\Stream\MemorySourceStream;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;

final class CSVDetectorTest extends TestCase
final class CSVDetectorTest extends FlowTestCase
{
public static function enclosure_provider() : \Generator
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
use function Flow\ETL\DSL\{df, print_schema, ref};
use Flow\ETL\Adapter\CSV\CSVExtractor;
use Flow\ETL\Extractor\Signal;
use Flow\ETL\{Config, FlowContext, Row, Rows};
use Flow\ETL\{Config, FlowContext, Row, Rows, Tests\FlowTestCase};
use Flow\Filesystem\Path;
use PHPUnit\Framework\TestCase;

final class CSVExtractorTest extends TestCase
final class CSVExtractorTest extends FlowTestCase
{
public function test_extracting_csv_empty_columns_as_empty_strings() : void
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use function Flow\ETL\Adapter\XML\{from_xml, to_xml};
use function Flow\ETL\DSL\{df, from_array, overwrite, ref};
use Flow\ETL\Tests\Double\FakeExtractor;
use Flow\ETL\Tests\Integration\FlowIntegrationTestCase;
use Flow\ETL\Tests\FlowIntegrationTestCase;

final class XMLLoaderTest extends FlowIntegrationTestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
Flow,
FlowContext,
PHP\Type\Caster,
Tests\Integration\FlowIntegrationTestCase};
Tests\FlowIntegrationTestCase};
use Flow\Filesystem\Path;

final class XMLParserExtractorTest extends FlowIntegrationTestCase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use function Flow\ETL\DSL\type_string;
use Flow\ETL\Adapter\XML\XMLReaderExtractor;
use Flow\ETL\Extractor\Signal;
use Flow\ETL\{Config, Flow, FlowContext, PHP\Type\Caster, Tests\Integration\FlowIntegrationTestCase};
use Flow\ETL\{Config, Flow, FlowContext, PHP\Type\Caster, Tests\FlowIntegrationTestCase};
use Flow\Filesystem\Path;

final class XMLReaderExtractorTest extends FlowIntegrationTestCase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use function Flow\ETL\Adapter\XML\from_xml;
use function Flow\ETL\DSL\{datetime_schema, df, int_schema, ref, schema, type_int};
use function Flow\Filesystem\DSL\path;
use Flow\ETL\Tests\Integration\FlowIntegrationTestCase;
use Flow\ETL\Tests\FlowIntegrationTestCase;

final class XMLTest extends FlowIntegrationTestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use function Flow\Filesystem\Bridge\AsyncAWS\DSL\aws_s3_client;
use AsyncAws\S3\S3Client;
use Flow\ETL\Tests\Integration\FlowIntegrationTestCase;
use Flow\ETL\Tests\FlowIntegrationTestCase;
use Flow\Filesystem\Path;

abstract class AsyncAWSS3TestCase extends FlowIntegrationTestCase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@

declare(strict_types=1);

namespace Flow\ETL\Tests\Integration;
namespace Flow\ETL\Tests;

use Flow\ETL\{Config\Cache\CacheConfig, Tests\FlowTestCase};
use Flow\ETL\{Config\Cache\CacheConfig};
use Flow\Filesystem\{Filesystem, Path};
use Flow\Filesystem\{FilesystemTable, Local\NativeLocalFilesystem, Local\StdOutFilesystem};
use Flow\Serializer\{Base64Serializer, NativePHPSerializer, Serializer};

/**
* Test case for integration tests.
*/
abstract class FlowIntegrationTestCase extends FlowTestCase
{
protected Path $cacheDir;
Expand Down
4 changes: 4 additions & 0 deletions src/core/etl/tests/Flow/ETL/Tests/FlowTestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
use Flow\ETL\{Extractor, FlowContext, Rows};
use PHPUnit\Framework\TestCase;

/**
* Base test case for testing FLow, designed mostly for unit tests.
* In case of integration tests, use FlowIntegrationTestCase that extends this class.
*/
abstract class FlowTestCase extends TestCase
{
final public static function assertExtractedBatchesCount(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use function Flow\ETL\DSL\{row, rows, str_entry};
use Flow\ETL\Cache\{CacheIndex};
use Flow\ETL\Exception\KeyNotInCacheException;
use Flow\ETL\Tests\Integration\FlowIntegrationTestCase;
use Flow\ETL\Tests\FlowIntegrationTestCase;

abstract class CacheBaseTestSuite extends FlowIntegrationTestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use function Flow\ETL\Adapter\Text\from_text;
use function Flow\ETL\DSL\{datetime_schema, df, float_schema, from_array, int_schema, schema, str_schema};
use Flow\ETL\Tests\Integration\FlowIntegrationTestCase;
use Flow\ETL\Tests\FlowIntegrationTestCase;

final class AnalyzeTest extends FlowIntegrationTestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use function Flow\ETL\DSL\{df, from_array, lit, ref, to_branch, to_memory};
use Flow\ETL\Memory\ArrayMemory;
use Flow\ETL\Tests\Integration\FlowIntegrationTestCase;
use Flow\ETL\Tests\FlowIntegrationTestCase;

final class BranchingTest extends FlowIntegrationTestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Flow\ETL\Cache\CacheIndex;
use Flow\ETL\Cache\Implementation\InMemoryCache;
use Flow\ETL\Tests\Double\FakeExtractor;
use Flow\ETL\Tests\Integration\FlowIntegrationTestCase;
use Flow\ETL\Tests\FlowIntegrationTestCase;
use Flow\ETL\{Extractor, FlowContext, Rows};

final class CacheTest extends FlowIntegrationTestCase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use function Flow\ETL\DSL\config_builder;
use Flow\ETL\Config\Cache\CacheConfig;
use Flow\ETL\Sort\SortAlgorithms;
use Flow\ETL\Tests\Integration\FlowIntegrationTestCase;
use Flow\ETL\Tests\FlowIntegrationTestCase;

final class ConfigBuilderTest extends FlowIntegrationTestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use Flow\ETL\DataFrame;
use Flow\ETL\Exception\InvalidArgumentException;
use Flow\ETL\Tests\Integration\FlowIntegrationTestCase;
use Flow\ETL\Tests\FlowIntegrationTestCase;

final class DataFrameJsonTest extends FlowIntegrationTestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ enum_entry,
type_string,
xml_entry};
use Flow\ETL\Tests\Fixtures\Enum\BackedStringEnum;
use Flow\ETL\Tests\Integration\FlowIntegrationTestCase;
use Flow\ETL\Tests\FlowIntegrationTestCase;
use Flow\ETL\{Extractor, FlowContext, Rows};

final class DisplayTest extends FlowIntegrationTestCase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Flow\ETL\Tests\Integration\DataFrame;

use function Flow\ETL\DSL\{df, from_array, ref};
use Flow\ETL\Tests\Integration\FlowIntegrationTestCase;
use Flow\ETL\Tests\FlowIntegrationTestCase;

final class FilterTest extends FlowIntegrationTestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
uuid_schema,
window};
use Flow\ETL\Memory\ArrayMemory;
use Flow\ETL\Tests\Integration\FlowIntegrationTestCase;
use Flow\ETL\Tests\FlowIntegrationTestCase;
use Flow\ETL\{Loader, Rows};

final class GroupByTest extends FlowIntegrationTestCase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

use function Flow\ETL\DSL\{datetime_entry, df, from_rows, int_entry, row, rows, str_entry};
use Flow\ETL\Join\Expression;
use Flow\ETL\Tests\Integration\FlowIntegrationTestCase;
use Flow\ETL\Tests\FlowIntegrationTestCase;
use Flow\ETL\{Flow, Join\Join, Loader};

final class JoinTest extends FlowIntegrationTestCase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
type_structure};
use Flow\ETL\Exception\InvalidArgumentException;
use Flow\ETL\Row\Entry\{IntegerEntry};
use Flow\ETL\Tests\Integration\FlowIntegrationTestCase;
use Flow\ETL\Tests\FlowIntegrationTestCase;
use Flow\ETL\{Extractor, FlowContext, Row, Rows};

final class LimitTest extends FlowIntegrationTestCase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
type_list,
type_string};
use Flow\ETL\Row;
use Flow\ETL\Tests\Integration\FlowIntegrationTestCase;
use Flow\ETL\Tests\FlowIntegrationTestCase;

final class MapTest extends FlowIntegrationTestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
rows_partitioned,
str_entry};
use function Flow\Filesystem\DSL\partition;
use Flow\ETL\Tests\Integration\FlowIntegrationTestCase;
use Flow\ETL\Tests\FlowIntegrationTestCase;
use Flow\ETL\{Rows};
use Flow\Filesystem\Partition;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Flow\ETL\Tests\Integration\DataFrame;

use function Flow\ETL\DSL\{bool_entry, df, from_rows, int_entry, json_entry, ref, str_entry};
use Flow\ETL\Tests\Integration\FlowIntegrationTestCase;
use Flow\ETL\Tests\FlowIntegrationTestCase;
use Flow\ETL\Transformer\StyleConverter\StringStyles;
use Flow\ETL\{Row, Rows};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
string_entry};
use Flow\ETL\Pipeline\SynchronousPipeline;
use Flow\ETL\Row\Schema;
use Flow\ETL\Tests\Integration\FlowIntegrationTestCase;
use Flow\ETL\Tests\FlowIntegrationTestCase;

final class SchemaTest extends FlowIntegrationTestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Flow\ETL\Config;
use Flow\ETL\Monitoring\Memory\Unit;
use Flow\ETL\Tests\Double\{FakeExtractor};
use Flow\ETL\Tests\Integration\FlowIntegrationTestCase;
use Flow\ETL\Tests\FlowIntegrationTestCase;

final class SortTest extends FlowIntegrationTestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Flow\ETL\Cache\CacheIndex;
use Flow\ETL\Cache\Implementation\InMemoryCache;
use Flow\ETL\Extractor\CacheExtractor;
use Flow\ETL\Tests\Integration\FlowIntegrationTestCase;
use Flow\ETL\Tests\FlowIntegrationTestCase;

final class CacheExtractorTest extends FlowIntegrationTestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Flow\ETL\Tests\Integration\Extractor;

use function Flow\ETL\DSL\{flow_context, from_path_partitions, rows};
use Flow\ETL\Tests\Integration\FlowIntegrationTestCase;
use Flow\ETL\Tests\FlowIntegrationTestCase;
use Flow\Filesystem\Path;

final class PathPartitionsExtractorTest extends FlowIntegrationTestCase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Flow\ETL\Tests\Integration\Filesystem\FilesystemStreams;

use Flow\ETL\Filesystem\FilesystemStreams;
use Flow\ETL\Tests\Integration\FlowIntegrationTestCase;
use Flow\ETL\Tests\FlowIntegrationTestCase;

abstract class FilesystemStreamsTestCase extends FlowIntegrationTestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
namespace Flow\ETL\Tests\Integration\Monitoring\Memory;

use Flow\ETL\Monitoring\Memory\{Configuration, Unit};
use Flow\ETL\Tests\Integration\FlowIntegrationTestCase;
use Flow\ETL\Tests\FlowIntegrationTestCase;

final class ConfigurationTest extends FlowIntegrationTestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
use function Flow\ETL\Adapter\CSV\{from_csv, to_csv};
use function Flow\ETL\DSL\{df, from_array, lit};
use Flow\ETL\Loader;
use Flow\ETL\Tests\Integration\FlowIntegrationTestCase;
use Flow\ETL\Tests\FlowIntegrationTestCase;

final class SynchronousPipelineTest extends FlowIntegrationTestCase
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Flow\ETL\Pipeline\{SynchronousPipeline};
use Flow\ETL\Sort\ExternalSort;
use Flow\ETL\Sort\ExternalSort\BucketsCache\FilesystemBucketsCache;
use Flow\ETL\Tests\Integration\FlowIntegrationTestCase;
use Flow\ETL\Tests\FlowIntegrationTestCase;
use Flow\Filesystem\Path;

final class ExternalSortTest extends FlowIntegrationTestCase
Expand Down
Loading