In order to write an end-to-end test, create a new folder with a flow catalog named flow.yaml.
You can then add extra files to run checks:
logsfile to check if certain logs exist among all the logs of the deployment, This usesgrepso you can use patterns supported bygrephere. This file requires you to specify the columns you want to match against as the first line. Only those columns are fetched from the database. This file also requires you to importmaterialize-logs.flow.yamlin your catalog.<table_name>.local.rowsrun a diff against content of<table_name>in the local postgres instance. This file requires you to specify the columns you want to match against as the first line. Only those columns are fetched from the database. The first column is used for ordering the items.<table_name>.tunnel.rowsrun a diff against content of<table_name>in the postgres instance that is behind an SSH tunnel. This file requires you to specify the columns you want to match against as the first line. Only those columns are fetched from the database. The first column is used for ordering the items.data-plane.stdoutanddata-plane.stderrcheck if certain lines against among the logs of the data plane. This usesgrepso you can use patterns supported bygrephere.- Similarly, there is
activate.stdout,activate.stderr,build.stdout,build.stderr,await.stdoutandawait.stderr.
Finally, make sure you add your new test to run-all.sh script so that it becomes part of the CI pipeline.
This directory includes an experimental approach for Python-based snapshot tests of flowctl connector sessions. To run them:
- Install Poetry for python.
- Run
poetry installto setup an environment with test dependencies. - Run
poetry run pytest tests/to run all tests. - If the snapshot is updated, add
--insta reviewto interactively review and update differences.