25 Commits

Author SHA1 Message Date
Kurtis Mullins 6dba36c7f3 Fix AMD64 dependency error in CLI Docker Build (#362)
Signed-off-by: Tyler Cloutier <cloutiertyler@users.noreply.github.com>
Co-authored-by: Kurtis Mullins <hello@kurtismullins.com>
2023-10-03 21:11:58 -05:00
Kurtis Mullins 5bd53a9462 Fix arm64 builds on Linux (#361)
Signed-off-by: Kurtis Mullins <github@kurtismullins.com>
2023-10-03 17:56:11 -07:00
Phoebe Goldman f0e4b004da Commit test clients' module_bindings (#346)
* 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
2023-10-02 16:56:52 -07:00
james gilles 010c7e3c1e Wrangle benchmarks (#289)
Refactor benchmarks framework to allow direct comparison of spacetime modules, the spacetime datastore not through a module, and sqlite.
2023-09-29 23:12:12 +00:00
Piotr Sarnacki 205ad6b2d7 Client binaries builds (#337)
This PR adds builds for client binaries for all of the platforms that we support. The binaries are uploaded to a DO Spaces bucket.
2023-09-28 19:16:43 +00:00
Phoebe Goldman 5f8615a367 Add SDK test that verifies connect/disconnect callbacks happen (#326)
* Add SDK test that verifies connect/disconnect callbacks happen

* Add C# connect/disconnect test

---------

Co-authored-by: Ingvar Stepanyan <me@rreverser.com>
2023-09-27 11:29:09 -04:00
Ingvar Stepanyan c47e571d2d Avoid relying on global CLI in tests (#294)
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>
2023-09-14 09:15:32 -04:00
Phoebe Goldman 32ac808804 SDK test suites (#258)
* 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
2023-09-12 12:50:47 -05:00
Noa 50e8e28463 Module/instance thread rework (#222)
* Module/instance thread rework

* Update docker action versions
2023-09-11 19:43:38 +00:00
Piotr Sarnacki 653ed4d103 Add labels to docker containers (#252) 2023-08-29 16:26:26 +02:00
Piotr Sarnacki 90db30e523 Build the Docker image only on the main branch (#195) 2023-08-23 20:54:49 +02:00
George Kulakowski 66a8f22e94 Remove the bitrotted trace replay functionality (#219)
* Remove the bitrotted trace replay functionality

* cargo fmt

* Remove unused tracelogging feature from ci actions

* Remove unneeded clone
2023-08-22 21:29:05 +00:00
George Kulakowski aa9a8452d1 Add an option for ABI breaks to the PR template (#213) 2023-08-21 10:49:31 -07:00
John Detter bf7b4b5806 Before, we were being limited to just 30 results. This impl will (#207)
paginate so that all members are returned

Co-authored-by: Boppy <no-reply@boppygames.gg>
2023-08-21 10:12:09 -05:00
John Detter 0f1fdf62d0 Upgrade contributor check perms (#194)
* Upgraded read permissions for contributor check

* Bug fix

* Another fix

* Changed secret that's used

---------

Co-authored-by: Boppy <no-reply@boppygames.gg>
2023-08-16 09:48:57 -07:00
John Detter 4ebbc514df Contributor Check CI (#192)
* 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>
2023-08-15 21:34:01 -05:00
Piotr Sarnacki b41945e2ac Tag docker images with git tag and build for more platforms (#145)
* Tag docker images with git tag

* More platforms
2023-08-07 18:06:31 +02:00
Piotr Sarnacki a1bff6d736 Build docker image in CI (#124) 2023-08-04 23:36:36 +02:00
Mario Montoya bc7706b799 Fix lint on test (#129)
* Fix lint on test

* Add to the CI
2023-08-02 09:55:40 -07:00
Phoebe Goldman 5a60c24d50 Add SDK API breakage checkbox to PR template (#83)
The Rust SDK lives in this repository
and exposes an API on which Rust clients will depend,
distinct from both the module API
and the ClientAPI (which is the protocols all SDKs use to commuticate with a module).

This commit adds a checkbox to the PR template,
in the style of the two existing checkboxes,
to identify breaking changes to the SDK API.
2023-08-01 23:17:03 +02:00
John Detter 0b0c533830 Smoketests run in parallel (#49)
* 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>
2023-08-01 23:17:03 +02:00
John Detter 047f06382e Use SpacetimeDB Large Runner (#81)
Co-authored-by: Boppy <no-reply@boppygames.gg>
2023-08-01 23:17:03 +02:00
John Detter 757719e7b4 Enable restart tests (#35)
* 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>
2023-08-01 23:17:02 +02:00
Tyler Cloutier 0b6cddca13 test (#1)
* test

* Fixed CI

* Fixed tests

* Fixed formatting

* Fixed test error by removing chrono default features

* Rename smoketests CI thing

* Hopefully fix the testing issue

* Fix typos

* Fixed install git-hooks

* Fixed formatting

* Fixed compile error

* fixed testing issues
2023-08-01 23:17:02 +02:00
Tyler Cloutier 44df6c6e7d Initial commit 2023-08-01 23:16:37 +02:00