OpenMetadata/ingestion/tests/cli_e2e
Mayur Singal 4e24ba1d8b
fix(cli-e2e): use profileSampleConfig in profiler test builders (#27947)
PR #27184 (commit 47c88d49ce, "Dynamic Sampling Config") moved
profileSample/profileSampleType out of DatabaseServiceProfilerPipeline
and TableProfilerConfig into a nested profileSampleConfig object, but
the CLI E2E test config builders weren't updated. Both pydantic models
now use extra='forbid', so the old format raises "Extra parameter
'profileSample'" and the scheduled py-cli-e2e-tests workflow has been
red on every run since 2026-04-17 (postgres, mysql, mssql, oracle,
redshift, snowflake, redash, metabase, quicksight, tableau,
bigquery_multiple_project, dbt_redshift).

Update the ProfilerConfigBuilder to emit the new schema and update the
BigQuery TableProfilerConfig usage to match.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-07 22:35:31 +05:30
..
base fix(cli-e2e): use profileSampleConfig in profiler test builders (#27947) 2026-05-07 22:35:31 +05:30
common chore(ingestion): drop pylint, expand ruff (#27774) 2026-04-28 07:21:59 +02:00
dashboard WIP: fix python e2e (#26219) 2026-03-09 11:27:08 +05:30
database Fix (#27660): Re-enable Exasol cli-e2e-tests after fixing issues (#27661) 2026-05-06 17:11:53 +05:30
dbt/redshift Fix #26178: Add support for IAM auth for redshift (#26179) 2026-03-02 21:57:28 +05:30
__init__.py Add CLI E2E tests for MySQL (#8041) 2022-10-10 11:36:20 +02:00
common_e2e_sqa_mixins.py postgres & redshift ddl and e2e fixes (#26367) 2026-03-10 17:43:42 +05:30
README.md chore: added python 3.12 to CI (#23835) 2025-10-10 17:26:45 +02:00
test_cli_athena.py chore(ingestion): drop pylint, expand ruff (#27774) 2026-04-28 07:21:59 +02:00
test_cli_bigquery.py fix(cli-e2e): use profileSampleConfig in profiler test builders (#27947) 2026-05-07 22:35:31 +05:30
test_cli_bigquery_multiple_project.py chore(ingestion): drop pylint, expand ruff (#27774) 2026-04-28 07:21:59 +02:00
test_cli_datalake_s3.py chore(ingestion): drop pylint, expand ruff (#27774) 2026-04-28 07:21:59 +02:00
test_cli_dbt_redshift.py chore(ingestion): drop pylint, expand ruff (#27774) 2026-04-28 07:21:59 +02:00
test_cli_exasol.py Fix (#27660): Re-enable Exasol cli-e2e-tests after fixing issues (#27661) 2026-05-06 17:11:53 +05:30
test_cli_hive.py chore(ingestion): drop pylint, expand ruff (#27774) 2026-04-28 07:21:59 +02:00
test_cli_metabase.py chore(ingestion): drop pylint, expand ruff (#27774) 2026-04-28 07:21:59 +02:00
test_cli_mssql.py chore(ingestion): drop pylint, expand ruff (#27774) 2026-04-28 07:21:59 +02:00
test_cli_mysql.py chore(ingestion): drop pylint, expand ruff (#27774) 2026-04-28 07:21:59 +02:00
test_cli_oracle.py chore(ingestion): drop pylint, expand ruff (#27774) 2026-04-28 07:21:59 +02:00
test_cli_postgres.py chore(ingestion): drop pylint, expand ruff (#27774) 2026-04-28 07:21:59 +02:00
test_cli_powerbi.py chore(ingestion): drop pylint, expand ruff (#27774) 2026-04-28 07:21:59 +02:00
test_cli_quicksight.py chore(ingestion): drop pylint, expand ruff (#27774) 2026-04-28 07:21:59 +02:00
test_cli_redash.py chore(ingestion): drop pylint, expand ruff (#27774) 2026-04-28 07:21:59 +02:00
test_cli_redshift.py chore(ingestion): drop pylint, expand ruff (#27774) 2026-04-28 07:21:59 +02:00
test_cli_snowflake.py chore(ingestion): drop pylint, expand ruff (#27774) 2026-04-28 07:21:59 +02:00
test_cli_tableau.py chore(ingestion): drop pylint, expand ruff (#27774) 2026-04-28 07:21:59 +02:00
test_cli_vertica.py chore(ingestion): drop pylint, expand ruff (#27774) 2026-04-28 07:21:59 +02:00

E2E CLI tests

How to add a connector

  1. Add an ingestion YAML file with the service and the credentials of it. Use when possible a Dockerized environment, otherwise, remember to use environment variables for sensitive information in case of external resources. On each test, the YAML file will be modified by the build_yaml method which will create a copy of the file and prepare it for the tests. This way, we avoid adding (and maintaining) an extra YAML for each test.

  2. The {connector} name must be added in the list of connectors in the GH Action: .github/workflows/py-cli-e2e-tests.yml


jobs:
  py-cli-e2e-tests:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        py-version: ['3.12']
        e2e-test: ['mysql', '{connector}']

Database connectors

Currently, it runs CLI tests for any database connector.

  • ./base/test_cli_db has 8 test definitions for database connectors. It is an abstract class.
  • ./common/test_cli_db is another abstract class for those connectors whose sources implement the CommonDbSourceService class.
  • It partially implements some methods from test_cli_db_base.
  • test_cli_{connector} is the specific connector test. More tests apart the ones implemented by the ./base/test_cli_db can be run inside this class.

How to add a database connector

  1. Use test_cli_mysql.py as example. Your connector E2E CLI test must follow the name convention: test_cli_{connector}.py and the test class must extend from CliCommonDB.TestSuite if the connector's source implement the CommonDbSourceService class, otherwise, from CliDBBase.TestSuite.

  2. If it is a database connector whose source implement the CommonDbSourceService class, these methods must be overwritten:

    # the connector name
    def get_connector_name() -> str:
        return "{connector}"

    # create using the SQLAlchemy engine a table, a view associated to it and add some rows to the table
    def create_table_and_view(self) -> None:
        pass
    
    # delete the view and table created using the SQLAlchemy engine
    def delete_table_and_view(self) -> None:
        pass
    
    # expected tables to be ingested
    def expected_tables() -> int:
        pass

    # numbers of rows added to the created table
    def inserted_rows_count(self) -> int:
        pass

    # created table FQN
    def fqn_created_table() -> str:
        pass

    # list of schemas patterns to be included in the schema filters
    def get_includes_schemas() -> List[str]:
        pass

    # list of table patterns to be included in the table filters
    def get_includes_tables() -> List[str]:
        pass

    # list of table patterns to be excluded in the table filters
    def get_excludes_tables() -> List[str]:
        pass
    
    # expected number of schemas to be filtered with the use of includes (get_includes_schemas)
    def expected_filtered_schema_includes() -> int:
        pass
    
    # expected number of schemas to be filtered with the use of excludes (get_includes_schemas)
    def expected_filtered_schema_excludes() -> int:
        pass

    # expected number of tables to be filtered with the use of includes (get_includes_tables)
    def expected_filtered_table_includes() -> int:
        pass

    # expected number of tables to be filtered with the use of excludes (get_includes_tables)
    def expected_filtered_table_excludes() -> int:
        pass

    # expected number of filter entities with the use of a mix of filters (get_includes_schemas, get_includes_tables, get_excludes_tables)
    def expected_filtered_mix() -> int:
        pass

Dashboard connectors

Currently, it runs CLI tests for any database connector.

  • ./base/test_cli_dashboard has 3 test definitions for database connectors. It is an abstract class.
  • ./common/test_cli_dashboard is another class that partially implements some methods from test_cli_dashboard_base.
  • test_cli_{connector} is the specific connector test. More tests apart the ones implemented by the ./base/test_cli_dashboard can be run inside this class.

How to add a dashboard connector

  1. Use test_cli_tableau.py as example. Your connector E2E CLI test must follow the name convention: test_cli_{connector}.py and the test class must extend from CliCommonDashboard.TestSuite.

  2. These methods must be overwritten:

    # in case we want to do something before running the tests
    def prepare() -> None:
        pass
    
    # the connector name
    def get_connector_name() -> str:
        return "{connector}"

    # the dashboard to include in filters
    def get_includes_dashboards() -> List[str]:
        pass

    # the dashboard to exclude in filters
    def get_excludes_dashboards() -> List[str]:
        pass

    # the charts to include in filters
    def get_includes_charts() -> List[str]:
        pass

    # the charts to exclude in filters
    def get_excludes_charts() -> List[str]:
        pass

    # the data models to include in filters
    def get_includes_datamodels() -> List[str]:
        pass
    
    # the data models to exclude in filters
    def get_excludes_datamodels() -> List[str]:
        pass
    
    # expected number of entities to be ingested
    def expected_entities() -> int:
        pass
    
    # expected number of lineage to be ingested
    def expected_lineage() -> int:
        pass
    
    # expected number of tags to be ingested
    def expected_tags() -> int:
        pass
    
    # expected number of entities to be filtered when testing include tags and data models options
    def expected_not_included_entities() -> int:
        pass

    # expected number of entities to be filtered in the sink step when testing include tags and data models options
    def expected_not_included_sink_entities() -> int:
        pass
    
    # expected number of entities to be filtered out when testing mix of filters
    def expected_filtered_mix() -> int:
        pass
        
    # expected number of entities to be filtered out in the sink step when testing mix of filters
     def expected_filtered_sink_mix() -> int:
        pass