{"id":24087935,"url":"https://github.com/tinybirdco/pytest-tinybird","last_synced_at":"2026-03-04T13:30:54.890Z","repository":{"id":150182384,"uuid":"603074507","full_name":"tinybirdco/pytest-tinybird","owner":"tinybirdco","description":"A pytest plugin to report test results to tinybird","archived":false,"fork":false,"pushed_at":"2025-06-27T08:49:25.000Z","size":47,"stargazers_count":9,"open_issues_count":4,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-27T09:32:23.695Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/tinybirdco.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,"zenodo":null}},"created_at":"2023-02-17T15:08:14.000Z","updated_at":"2025-05-07T08:54:55.000Z","dependencies_parsed_at":"2023-07-25T18:49:29.772Z","dependency_job_id":"9f29c7d3-8ae4-4085-a085-1087fbce14ef","html_url":"https://github.com/tinybirdco/pytest-tinybird","commit_stats":null,"previous_names":["jlmadurga/pytest-tinybird"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/tinybirdco/pytest-tinybird","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinybirdco%2Fpytest-tinybird","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinybirdco%2Fpytest-tinybird/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinybirdco%2Fpytest-tinybird/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinybirdco%2Fpytest-tinybird/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tinybirdco","download_url":"https://codeload.github.com/tinybirdco/pytest-tinybird/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tinybirdco%2Fpytest-tinybird/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30081402,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T13:22:36.021Z","status":"ssl_error","status_checked_at":"2026-03-04T13:20:45.750Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":[],"created_at":"2025-01-10T03:56:15.472Z","updated_at":"2026-03-04T13:30:54.856Z","avatar_url":"https://github.com/tinybirdco.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"pytest-tinybird\n===================================\n\nA pytest plugin to report test results to Tinybird. At the end of every run, this plugin posts results using the [Tinybird Events API](https://www.tinybird.co/docs/ingest/events-api.html). \n\n[![PyPI version](https://badge.fury.io/py/pytest-tinybird.svg)](https://badge.fury.io/py/pytest-tinybird)\n![Passed](https://github.com/jlmadurga/pytest-tinybird/actions/workflows/main.yml/badge.svg)\n![Top test passed](https://img.shields.io/endpoint?url=https://api.tinybird.co/v0/pipes/top_test_passed.ndjson?token=p.eyJ1IjogIjNhZjhlMTBhLTM2MjEtNDQ3OC04MWJmLTE5MDQ5N2UwNjBjYiIsICJpZCI6ICJkNDNmZGQ2Ni03NzY1LTQzZGYtYjEyNS0wYzNjYWJiMDgxZjUifQ.yWypEczMfJlgkjNt29pCf45XaxE1dMOr-oznll5tjpY)\n\n\n\nRequirements\n------------\n\n- Python \u003e=3.8\n- pytest 3.8 or newer (previous versions might be compatible)\n- [Tinybird account](https://www.tinybird.co/) and a [token with append permissions](https://www.tinybird.co/docs/concepts/auth-tokens.html?highlight=token#auth-token-scopes)\n\n\nInstallation\n------------\n\npypi install package: https://pypi.org/project/pytest-tinybird/\n\nYou can install the plugin with the following bash command:\n\n```bash\n  $ pip install pytest-tinybird\n```\n\n\nUsage\n------------\n\nYou just need your [Tinybird](https://www.tinybird.co/) account and a Token with append permissions\n\nSet these env variables:\n\n```bash\nexport TINYBIRD_URL=\u003chttps://api.tinybird.co|https://api.us-east.tinybird.co\u003e   # depends on your region\nexport TINYBIRD_DATASOURCE=\u003cdatasource_name\u003e  # will be created with first results posted\nexport TINYBIRD_TOKEN=\u003ctoken_with_append_permissions\u003e\n```\n\nThen run pytest with `--report-to-tinybird`.\n\n\n```bash\n$ pytest tests --report-to-tinybird\n```\n\nCI execution info can also be set using some env variables. These are from GitLab:\n\n```bash\nCI_COMMIT_SHA\nCI_COMMIT_BRANCH\nCI_JOB_ID\nCI_JOB_NAME\nCI_JOB_URL\n```\n\nIf you are not using GitLab, you will need to set them manually. For instance, for GitHub actions you can check our current [GitHub actions workflow](https://github.com/tinybirdco/pytest-tinybird/blob/master/.github/workflows/main.yml).\n\nData Source details\n--------------------\n\nThe `pytest-tinybird` plugin creates and sends `report` objects via the [Events API](https://www.tinybird.co/docs/ingest/events-api.html) with this structure:\n\n```\n{\n\t'date': now,\n\t'commit': self.commit,\n\t'branch': self.branch,\n\t'job_id': self.job_id,\n\t'job_url': self.job_url,\n\t'job_name': self.job_name,\n\t'test_nodeid': test.nodeid,\n\t'test_name': test.head_line,\n\t'test_part': test.when,\n\t'duration': test.duration,\n\t'outcome': test.outcome\n}\n```\n\nWhen a `report` object is first sent to Tinybird, a Data Source with the following definition and schema is created:\n\n```sql\nTOKEN \"pytest-executor-write\" APPEND\n\nSCHEMA \u003e\n    `commit` String `json:$.commit`,\n    `branch` String `json:$.branch`,\n    `date` DateTime `json:$.date`,\n    `duration` Float32 `json:$.duration`,\n    `job_id` String `json:$.job_id`,\n    `job_name` String `json:$.job_name`,\n    `job_url` String `json:$.job_url`,\n    `outcome` LowCardinality(String) `json:$.outcome`,\n    `test_name` String `json:$.test_name`,\n    `test_nodeid` String `json:$.test_nodeid`,\n    `test_part` LowCardinality(String) `json:$.test_part`\n\nENGINE MergeTree\nENGINE_PARTITION_KEY toYYYYMM(date)\n```\n\nYou can also see the Data Source schema with this [data sample](https://api.tinybird.co/v0/pipes/ci_tests_sample.json?token=p.eyJ1IjogIjNhZjhlMTBhLTM2MjEtNDQ3OC04MWJmLTE5MDQ5N2UwNjBjYiIsICJpZCI6ICIwNzMwZTJjYy1mYzA4LTQxMDMtOTMwNy1jMThjYWY5OGI4OGUifQ.kpCQfin0KFC8olEju1qVqDH14nlSzGgqjAWpl1k7RUI)\nfrom an API Endpoint created from the Data Source the `pytest-tinybird` plugin populates.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinybirdco%2Fpytest-tinybird","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftinybirdco%2Fpytest-tinybird","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftinybirdco%2Fpytest-tinybird/lists"}