Rust
Note: The
DATABASE_URLmust be present as environment variable for the database tests. TheDATABASE_URLis automatically set using thebuild.rsfile if the build is not a release build.
Running all tests
cargo testRunning tests for a specific workspace member
cargo test -p item_producerVitest
Running unit/component tests
npm testPlaywright
Running End-to-End tests locally
npm run e2eThe following command is recommended when writing End-to-End tests.
npm run e2e -- --uiTo use Playwright codegen run the following command.
npm run codegenNote:
npm run sqlx:prepareruns thesrcs/scripts/sqlx_prepare.shscript, which by default runscargo sqlx prepareon all crates individually. Available options areall,item_producer,user_service, andtauri.
The docker images do not have access to a database with migrations applied during build-time. To ensure the docker image can be built, the json files under the .sqlx directory must be up-to-date and committed.
The following script automatically sets-up each database and applies migrations using the build.rs config defined within each crate and then prepares the .sqlx cache directory.
docker compose up -d
npm run sqlx:prepare