* Commit test clients' module_bindings
Having discussed with the team, I've come around to it being correct
to commit the `module_bindings` for the SDK tests' two test clients.
This way, people not working on codegen can run `cargo test --workspace` &c,
and open the test clients with rust-analyzer without any additional rigamarole.
The downside is that any time codegen changes,
we'll see very large commits touching all of these files,
but consensus is we don't really care.
An additional upside is that now we can run clippy against the bindings in CI,
which will incentivize ensuring that the bindings generate lint-free code.
* Add linguist-generated=true for generated module bindings
* Top-level .gitattributes sets `module_bindings` as generated
This switches tests from invoking a spacetimedb CLI found on PATH to always using up-to-date version by depending on the CLI crate as a library.
---------
Signed-off-by: Phoebe Goldman <phoebe@goldman-tribe.org>
Co-authored-by: Phoebe Goldman <phoebe@clockworklabs.io>
* Simple SDK test harness; SDK test module
Yet to come: actual SDK tests.
* Quiet clippy lint about "too many arguments"
* Lints are named with underscores, not dashes...
* Will this make clippy shut up?
* Go nuclear on disabling `too_many_attributes` lint. Sigh.
* WIP SDK test client, and fix bugs in Rust codegen
Compiling the module_bindings for the sdk-test module revealed two bugs:
- Enums holding structs generated incorrectly,
unpacking the struct into the enum's payload.
- Recursive types would cause the codegen to attempt to recursively import
the current module into itself.
* One (1) actual runnable test in the sdk crate
* Exclude test-client from CI
The sdk tests already build this crate (though they don't clippy or fmt it).
Attempting to build, test, fmt or clippy it as-is will fail
because the module_bindings are not committed.
This is intentional, as the SDK test suite wants to generate the module_bindings
during its run.
* Rustfmt ignore generated module_bindings
It turns out `cargo fmt` doesn't actually support the `--exclude` option
the way `cargo clippy` does.
Instead, just `#[rustfmt::skip]` the `mod module_bindings;` decl.
* Actually commit test file...
God, I'm so bad at remembering to commit new files.
Anyway, add a test for deleting rows with primitive unique fields.
* Make CLI tool available in tests workflow
The SDK tests need to run `spacetime start`, `spacetime generate` and `spacetime publish`.
* Test update events with primitive pk types; split test-client into files
* Tests with `Identity` fields in tables
* Tests for reducer callbacks, both successful and failing
* Tests with vecs of stuff, with structs, with enums
* Test that should fail, test that uses a large table with many columns
* Test for resubscribe functionality
* Test of reauth; fix major bug in `TestCounter`
I misread `Condvar::wait_timeout_while` as `Condvar::wait_timeout_until`,
and flipped my predicate.
This led to false negatives (i.e. tests that passed that shouldn't have).
* A fistful of doc comments
* Avoid race condition running multiple tests with same client project
This commit fixes a race condition which sometimes caused the SDK tests to fail
because multiple `spacetime generate` processes running concurrently
would clobber each others' output,
potentially deleting it while a `cargo build` or `cargo run` process was running.
Now, the test harness will only run `spacetime generate` at most once
for any given directory.
* Add env_logger to SDK test client
* RUST_LOG=trace when running test clients
* quieter logs in test client: only warn-level and higher
* Added contributor check
* Bump node version
* Added node-fetch
* Another fix
* Bug fix
* Give action a real name
* Added name for docker build
* Rename
* Fixed name so they match
---------
Co-authored-by: Boppy <no-reply@boppygames.gg>
* Working on improving commands that use identities
* Fix lints
* Reverted file that shouldn't have changed
* Found and fixed all other todos
* Addressed more CLI TODOs
* Fixes for formatting issues
* Set names of identities
* Set name of identities + clippy
* Small fix
* Added the start of a doc comment, switching over to another PR
* Fixed tests that needed to be updated
* Addressed more feedback and fixed several clippy issues
* Small fix
* Apply suggestions from code review
Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>
Signed-off-by: John Detter <4099508+jdetter@users.noreply.github.com>
* Added more doc comments
* Addressing more feedback
* Fixed really old bug in SpacetimeDB
* Tests to verify new functionality
* Fix clippy lints
* Email during identity creation is optional
* Some work
* Getting smoketests working on mac
* All tests are passing except known failing tests
* Working on parallel smoketests
* Fixed some bugs in saving configs that was preventing this from working
* Fixes required for parallel tests
* Tests are working in parallel
* Pruned changes
* retab
* re-retab
* retab the lib file
* Cargo profile for building more quickly
* I have to rebase on another PR
* smoketest fixes
* create_project and reset_project are now the same thing, removed
create_project
* More fixes
* Removed print statement
* Small fix
* Another fix
* Tons of improvements to the smoketests
* Have to rebase on master
* Small fixes
* More progress
* Finally working correctly!
* Apparently we're missing this
* Enable command output
* Listing installed targets
* Clean before building
* What is going on
* Something super wonky going on
* Another test
* Skip building containers for now
* Small fix
* Test using cargo instead
* Changed workflow a bit
* CI is stuck
* Small fix
* Another fix
* Try cargo run instead of building spacetime CLI
* Removed workflow step
* Fixing all of the tests
* Identity test
* Tests should finally be working
* Enable debug
* Remove spacetime from path
* Another try
* Logic fix
* Another fix
* Another fix
* Working now?
* Another fix
* Finally working again
* Adding github containers back in
* CI fix
* Use SpacetimeDB Large Runner
* Updated test to get more output
* Changed 0ms to 10ms to improve parallel test stability
* Removed unused logs
Signed-off-by: John Detter <4099508+jdetter@users.noreply.github.com>
* Removed unnecessary reset_project
* Removed reset_config where its not needed
* Reset template
---------
Signed-off-by: John Detter <4099508+jdetter@users.noreply.github.com>
Co-authored-by: Boppy <no-reply@boppygames.gg>
Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>
* Fixes the restart problem (i.e. rebuilding the datastore from the message log)
* Remove logging
* Enable restart tests
* Fixed small issues with tests
* Fixed restart-repeating-reducer test probably
---------
Co-authored-by: Tyler Cloutier <cloutiertyler@aol.com>
Co-authored-by: Boppy <no-reply@boppygames.gg>