{"id":15099794,"url":"https://github.com/dylibso/testing-xtp-plugins","last_synced_at":"2026-02-11T12:41:36.220Z","repository":{"id":253990899,"uuid":"845157499","full_name":"dylibso/testing-xtp-plugins","owner":"dylibso","description":"An end-to-end example of testing XTP plugins which call host functions + example mocked host functions.","archived":false,"fork":false,"pushed_at":"2025-02-11T17:11:34.000Z","size":22,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-08-30T23:54:02.794Z","etag":null,"topics":["example","golang","host","mock","testing","typescript","wasm","xtp","zig"],"latest_commit_sha":null,"homepage":"https://docs.xtp.dylibso.com/docs/concepts/testing-plugins","language":"Zig","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dylibso.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":"2024-08-20T17:35:53.000Z","updated_at":"2025-06-18T02:11:12.000Z","dependencies_parsed_at":null,"dependency_job_id":"bfe2c7c4-993a-42fe-8ffd-2622911fdda4","html_url":"https://github.com/dylibso/testing-xtp-plugins","commit_stats":null,"previous_names":["dylibso/testing-xtp-plugins"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/dylibso/testing-xtp-plugins","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dylibso%2Ftesting-xtp-plugins","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dylibso%2Ftesting-xtp-plugins/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dylibso%2Ftesting-xtp-plugins/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dylibso%2Ftesting-xtp-plugins/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dylibso","download_url":"https://codeload.github.com/dylibso/testing-xtp-plugins/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dylibso%2Ftesting-xtp-plugins/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29333113,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T06:13:03.264Z","status":"ssl_error","status_checked_at":"2026-02-11T06:12:55.843Z","response_time":97,"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":["example","golang","host","mock","testing","typescript","wasm","xtp","zig"],"created_at":"2024-09-25T17:27:41.223Z","updated_at":"2026-02-11T12:41:36.190Z","avatar_url":"https://github.com/dylibso.png","language":"Zig","readme":"# Testing XTP Plugins with Host Functions\n\n## Repository Overview\n\n### `mock`\n\nThis directory contains the implementation of the mocked host functions. Note\nthat these functions are Extism plugin exports, which become imports to the\nplugin that calls the host functions.\n\n### `plugin`\n\nThis directory contains an example XTP plugin, based on the `schema.yaml`\nschema. It calls the host functions from its export `handleLogEvent` and\naggregates the count of events per event source. We test this plugin's behavior\nand the host function integration by running it several times with different\ninputs to see that the KV data and plugin aggregation of that data is correct.\n\n### `test`\n\nThis directory contains the test code that calls into the code in `plugin` to\ntest various aspects of it.\n\n## Building\n\nBefore compiling the contents, please ensure that you have the following\ninstalled:\n\n- [`xtp`](https://docs.xtp.dylibso.com/docs/cli#installation) (any recent\n  version)\n- [`tinygo`](https://tinygo.org/getting-started/install/) (\u003e= 0.31.2)\n- [`zig`](https://ziglang.org/) (\u003e= 0.13.0)\n- [`extism-js`](https://github.com/extism/js-pdk?tab=readme-ov-file#install-the-compiler)\n  (\u003e= 1.0.0-rc11)\n- [`npm`](https://nodejs.org) (\u003e= 10.2.4)\n\nWith all of the above installed, you can now run:\n\n```sh\nmake build\n```\n\n## Testing\n\nAfter you've built the `mock`, `plugin` and `test` modules, you can run:\n\n```sh\nmake test\n```\n\nor:\n\n```sh\ncd plugin\nxtp plugin test # note: the plugin/xtp.toml [[test]] configuration\n```\n\n## Questions or need help?\n\nFile [an issue](https://github.com/dylibso/testing-xtp-plugins/issues) on this\nrepository, or reach out to us on the\n[Extism Discord](https://extism.org/discord) and we can provide assistance.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdylibso%2Ftesting-xtp-plugins","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdylibso%2Ftesting-xtp-plugins","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdylibso%2Ftesting-xtp-plugins/lists"}