{"id":27323328,"url":"https://github.com/spinframework/spin-test","last_synced_at":"2025-10-16T06:02:56.426Z","repository":{"id":233592708,"uuid":"775599149","full_name":"spinframework/spin-test","owner":"spinframework","description":"A utility for testing Spin applications","archived":false,"fork":false,"pushed_at":"2025-08-29T20:58:05.000Z","size":18751,"stargazers_count":18,"open_issues_count":25,"forks_count":8,"subscribers_count":11,"default_branch":"main","last_synced_at":"2025-10-06T21:03:28.371Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spinframework.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","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,"notice":null,"maintainers":"MAINTAINERS.md","copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-03-21T17:27:37.000Z","updated_at":"2025-06-23T10:05:06.000Z","dependencies_parsed_at":"2024-05-13T09:46:21.877Z","dependency_job_id":"31acb89c-b6aa-40a4-9822-e0e04625f3aa","html_url":"https://github.com/spinframework/spin-test","commit_stats":null,"previous_names":["fermyon/spin-test","spinframework/spin-test"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/spinframework/spin-test","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spinframework%2Fspin-test","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spinframework%2Fspin-test/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spinframework%2Fspin-test/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spinframework%2Fspin-test/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spinframework","download_url":"https://codeload.github.com/spinframework/spin-test/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spinframework%2Fspin-test/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278679347,"owners_count":26027054,"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-06T02:00:05.630Z","response_time":65,"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":[],"created_at":"2025-04-12T10:37:16.058Z","updated_at":"2025-10-06T21:04:30.654Z","avatar_url":"https://github.com/spinframework.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# `spin-test`\n\n`spin-test` is a plugin for Spin that runs tests written in WebAssembly against a Spin application where all Spin and WASI APIs are configurable and assertable mocks.\n\n## Usage\n\n`spin-test` can be used as a stand alone binary or as a plugin for Spin.\n\nBefore using `spin-test`, make sure you've [installed Spin](https://developer.fermyon.com/spin/v2/install).\n\n### Install `spin test` (Spin plugin)\n\nTo install `spin-test` as a Spin plugin, run the following:\n\n```\nspin plugin install -u https://github.com/spinframework/spin-test/releases/download/canary/spin-test.json\n```\n\nThis will install the plugin which can be invoked with `spin test`.\n\nCurrently only a canary version (that matches the code on the `main` branch) is available at this time. This does mean that breaking changes may come with any upgrade of the plugin. In the future, stable, non-canary releases will also be made available.\n\n#### Or install a locally built version\n\nTo install a version of `spin-test` plugin that has been locally built using `cargo build --release`, use the following command:\n\n```bash\nspin pluginify -i\n```\n\nNote: the [`pluginify`](https://github.com/spinframework/spin-plugins/blob/main/manifests/pluginify/pluginify.json) plugin is a pre-requisite.\n\n### Or install `spin-test` (stand alone)\n\nAlternatively, to install `spin-test` as a stand alone binary, run `cargo build --release` from this directory and ensure that the resulting binary is located on your path.\n\nIf you'd rather not build from source, you can find a pre-built binary inside the plugin tarballs included in [any release](https://github.com/spinframework/spin-test/releases). In the latest stable release or in the canary release, find the tarball asset corresponding to the appropriate machine architecture, download the tarball, unarchive it, and retrieve the `test` binary inside it. Place this binary somewhere on your path as `spin-test` and invoke by running `spin-test`.\n\n### Create a Spin App\n\n`spin-test` runs tests against a Spin application. As such, you'll need a Spin app to test against. You can find more information on creating Spin applications [here](https://developer.fermyon.com/spin/v2/quickstart).\n\n### Create a `spin-test` test\n\nNext you'll need a `spin-test` test compiled to a WebAssembly component.\n\nThere is currently first class support for Rust through the [`spin-test` Rust SDK](./crates/spin-test-sdk/), but any language with support for writing WebAssembly components can be used as long as the `fermyon:spin-test/test` world is targeted. You can find the definition of this world in [here](./host-wit/world.wit).\n\nYou can see examples of tests written in a variety of languages in [the examples](./examples/).\n\n### Configure `spin-test`\n\nNext, we'll need to tell `spin-test` where our test lives and how to build it. We do this from inside the `spin.toml` manifest. Let's imagine our app has a component named \"my-component\" that we want to test. In the `spin.toml` manifest we can add the following configuration:\n\n```toml\n[component.my-component.tool.spin-test]\n# A relative path to where the built test component binary will live.\nsource = \"target/wasm32-wasip1/release/test.wasm\"\n# A command for building the target component.\nbuild = \"cargo component build --release\"\n# The directory where the `build` command should be run.\nworkdir = \"../../test-rs\"\n```\n\n### Run `spin test`\n\nFinally, we're ready for our test to be run. We can do this simply by invoking the `spin test` plugin from the directory where our Spin application lives:\n\n```bash\nspin test\n```\n\n\u003e *Note*: if you've installed `spin-test` as a stand alone binary instead of as a Spin plugin, you'll need to invoke it as `spin-test` instead of with a space like `spin test`.\n\n## Examples\n\nSee the [`examples`](./examples/) directory for a few examples of `spin-test` tests that test the apps in the [`apps`](./examples/apps/) directory.\n\n## Building from source and contributing\n\nSee the [guide on contributing for more information](./CONTRIBUTING.md).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspinframework%2Fspin-test","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspinframework%2Fspin-test","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspinframework%2Fspin-test/lists"}