{"id":16108647,"url":"https://github.com/itallix/python_bdd_testcontainers_demo","last_synced_at":"2025-10-15T11:09:06.683Z","repository":{"id":75097170,"uuid":"545456263","full_name":"itallix/python_bdd_testcontainers_demo","owner":"itallix","description":"Demo code for testing data migration from MS SQL Server into Google Datastore with pytest_bdd and testcontainers","archived":false,"fork":false,"pushed_at":"2022-10-04T12:09:27.000Z","size":56,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-06T04:25:16.990Z","etag":null,"topics":["bdd","pytest-bdd","python","testcontainers"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/itallix.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-10-04T12:04:50.000Z","updated_at":"2022-10-04T12:31:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"ff96e470-865e-4769-b492-608066521c35","html_url":"https://github.com/itallix/python_bdd_testcontainers_demo","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/itallix/python_bdd_testcontainers_demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itallix%2Fpython_bdd_testcontainers_demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itallix%2Fpython_bdd_testcontainers_demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itallix%2Fpython_bdd_testcontainers_demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itallix%2Fpython_bdd_testcontainers_demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itallix","download_url":"https://codeload.github.com/itallix/python_bdd_testcontainers_demo/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itallix%2Fpython_bdd_testcontainers_demo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279075671,"owners_count":26097968,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-15T02:00:07.814Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bdd","pytest-bdd","python","testcontainers"],"created_at":"2024-10-09T19:27:38.468Z","updated_at":"2025-10-15T11:09:06.665Z","avatar_url":"https://github.com/itallix.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `bdd_testcontainers_demo`\n\n![BDD Tests](https://github.com/itallix/py_bdd_testcontainers_demo/actions/workflows/test.yaml/badge.svg)\n\nThe purpose of this code is to demonstrate the technique of testing the data\nmigration scenario with [`pytest-bdd`](https://github.com/pytest-dev/pytest-bdd)\n and [`testcontainers`](https://github.com/testcontainers/testcontainers-python).\nWhen the nature of the source and target data is quite different (e.g. SQL -\u003e NoSQL),\nand the mapping between those requires building additional logic. Then testing and\nhaving fast development feedback loop becomes very important.\n\nAs a source for data migration here, we use MSSQL DB and as a target - Google Datastore.\nHowever, this testing recipe could be easily adapted to many types of data sources/targets.\n\n## Mapping from MSSSQL to Datastore\n\nThe following schema shows high level overview of the mapping that we are\ngoing to use in our example:\n\n![Mapping](./doc/sql_to_datastore_mapping.svg)\n\n-   Source data lives in the SQL DB and is scattered in various tables\n-   Target data should live in the NoSQL store and capture all source data in\nthe single kind\n-   Mapping between these two assumes building some SQL query and transforming\nsome data\n\n## Running tests\n\n### Prerequisites\n\n-   Make sure that you have [Poetry](https://python-poetry.org/docs/) installed \nfor dependency management\n-   Depending on your system, `pyodbc` might require additional binary dependency,\nsee more [here](https://pypi.org/project/pyodbc/)\n-   Initialize an environment with `poetry install`\n\n```bash\npoetry run pytest tests/bdd\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitallix%2Fpython_bdd_testcontainers_demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitallix%2Fpython_bdd_testcontainers_demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitallix%2Fpython_bdd_testcontainers_demo/lists"}