Commit Graph

45 Commits

Author SHA1 Message Date
Mario Montoya 730d49972b Remove duplicate assertSql in smoke test (#3588)
# Description of Changes

Small cleanup of duplicate logic on smoke tests

# Expected complexity level and risk
1
# Testing
- [x] Run smoke tests

Co-authored-by: joshua-spacetime <josh@clockworklabs.io>
2025-12-02 08:23:15 +00:00
Zeke Foppa 3395b1e905 CI - Cache more of our build outputs (#3521)
# Description of Changes

Changes with cache hit:
CI / Smoketests (spacetimedb-runner): 17m -> 10m
CI / Smoketests (windows-latest): 39m -> 31m
CI / Lints: 3m30s -> 2m
unity-testsuite: 23m -> 19m

This included creating a stripped-down `Dockerfile` that only runs
SpacetimeDB (as opposed to e.g. building tracy, flamegraphs, etc.). That
shaves off about 4-5m on the linux smoketests job.

# API and ABI breaking changes

No. CI only.

# Expected complexity level and risk

2

# Testing

Ran existing CI and noted the change in times in the description above

---------

Signed-off-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
Co-authored-by: John Detter <4099508+jdetter@users.noreply.github.com>
2025-11-19 20:18:26 +00:00
Kim Altintop a36f7091d5 [teams 3/5] API authorization, CLI, smoketests (#3523)
This adds authorization to the relevant API endpoints, updates the CLI
commands and adds smoketests for the teams feature.

**Note**: Authorizing SQL (incl. subscriptions) is a bit more involved,
and submitted as a separate PR in the series.

Depends-on: https://github.com/clockworklabs/SpacetimeDB/pull/3519
2025-11-11 14:10:58 +00:00
Kim Altintop e331b2f0e5 smoketests: Adjust enable replication tests (#3590)
Enabling replication now requires the database to be suspended.
Adjust the tests to account for that.
2025-11-07 05:17:39 +00:00
Noa 18af6c46ad Fix some annoyances with the smoketests (#3556)
# Description of Changes

Now running `python -m smoketests` no longer updates
`smoketests/config.toml` with a new identity, and also `replication`
doesn't fail when docker isn't available.

# Expected complexity level and risk

1

# Testing

- [x] those things no longer happen

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-11-05 17:07:35 +00:00
Noa 3cc59de66c Add typescript quickstart smoketest (#3463)
# Description of Changes

Based on #3461, which fixes a bug encountered in the quickstart.

# API and ABI breaking changes

<!-- If this is an API or ABI breaking change, please apply the
corresponding GitHub label. -->
n/a

# Expected complexity level and risk

<!--
How complicated do you think these changes are? Grade on a scale from 1
to 5,
where 1 is a trivial change, and 5 is a deep-reaching and complex
change.

This complexity rating applies not only to the complexity apparent in
the diff,
but also to its interactions with existing and future code.

If you answered more than a 2, explain what is complex about the PR,
and what other components it interacts with in potentially concerning
ways. -->
1

# Testing

<!-- Describe any testing you've done, and any testing you'd like your
reviewers to do,
so that you're confident that all the changes work as expected! -->

- [x] Yes
- [ ] <!-- maybe a test you want a reviewer to do, so they can check it
off when they're satisfied. -->
2025-10-31 16:30:11 +00:00
Piotr Sarnacki 647be7e9c0 spacetime init rewrite (#3366)
This is a draft of the new functionality for `spacetime init`. In order
to run it with built-in templates you have to set the path to the config
file:

```
export SPACETIMEDB_CLI_TEMPLATES_FILE=crates/cli/.init-templates.json
```

In the future it will fetch the list from GH.

A few notes:

* the previous functionality of `spacetime init` does not work at the
moment
* the code needs a bit more cleanup and tests before merging
* there is a bit of a mix in how we generate empty server and client
projects. For Rust we use the existing way of generating. For TypeScript
we clone an empty project from the repo. I wanted to play with both ways
of doing things, and I'm still not sure which is better. Generation in
Rust means that the generated code will match the CLI version and not
necessarily whatever is in Git. On the other hand, for the builtin
templates we will be fetching the newest version from GH, which I guess
might also not what we want, ie. we probably want only stable templates.
More discussion is needed here
* we use `spacetimedb` directory for the server files
* I don't particularly like the inability to disable interactive mode
easily. We discussed disabling it by default if all of the required
arguments are passed, but I don't think it's feature proof. For example,
if someone relies on a non-interactive mode, and we add a new required
argument, instead of printing a message `missing --foo`, we will
automatically launch interactive mode, which is harder to debug. That's
why I think I'd prefer to implement `--non-interactive` argument
* it's kind of hard to keep the legacy behaviour. If you don't pass any
arguments, we go into interactive mode. In the legacy version, we would
print required arguments. If someone passes `--lang` or `--project-path`
explicitly, I guess we could run the legacy workflow, but not sure if
it's worth it, as the command was marked as unstable anyway
* the project path defaults to the project name, but I think we should
probably replace change whitespaces to dashes, or at least ask for the
project path with the project name being the default (or both)

---------

Signed-off-by: Tyler Cloutier <cloutiertyler@users.noreply.github.com>
Signed-off-by: John Detter <4099508+jdetter@users.noreply.github.com>
Co-authored-by: = <cloutiertyler@gmail.com>
Co-authored-by: Tyler Cloutier <cloutiertyler@users.noreply.github.com>
Co-authored-by: Tyler Cloutier <cloutiertyler@aol.com>
Co-authored-by: John Detter <4099508+jdetter@users.noreply.github.com>
2025-10-30 04:26:08 +00:00
Shubham Mishra 54b07d0b87 cli: pre-publish endpoint call. (#3278)
# Description of Changes
PR contains:

* CLI changes for the `pre_publish` endpoint when publishing a module.
* The regular `--yes` flag will not bypasses the *break clients* warning
prompt — an extra confirmation is now required. For CI, a hidden flag
`--break-clients` is added.
* Added smoketest.
* Some trivial naming changes in `client-api-*` crates for consistency
reasons.
* `pre_publish` route to accept similar Body size limit as `publish`
route.



# API and ABI breaking changes
an additive API change, does not break anything.

# Expected complexity level and risk
2

# Testing
- Existing smoketests passing for backward compatibility.
- New smoketest for add columns

---------

Signed-off-by: Shubham Mishra <shivam828787@gmail.com>
Co-authored-by: Phoebe Goldman <phoebe@clockworklabs.io>
Co-authored-by: Zeke Foppa <196249+bfops@users.noreply.github.com>
2025-10-01 18:26:03 +00:00
Zeke Foppa 20a33de24b Finish making PG tests use a dynamic server address (#3277)
# Description of Changes

Finish the work started in #3227, which switched a hardcoded `127.0.0.1`
to a dynamic server address.

# API and ABI breaking changes

None.

# Expected complexity level and risk

1

# Testing

- [x] Smoketests still pass
- [ ] `Internal Tests` pass under this PR (they don't on master)

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-09-23 22:19:10 +00:00
Kim Altintop 321e4302ef smoketests: Smoketest enable replication for existing database (#3138)
Adds a (basic) smoketest that shows that we can enable, disable and
enable again replication on an existing, non-replicated database.
2025-09-18 07:21:22 +00:00
Kim Altintop f394de32d9 Confirmed reads (#3133)
# Description of Changes

Implements [subscribing to durable
commits](https://github.com/clockworklabs/SpacetimeDBPrivate/issues/1594).

The setting works on a per-connection level, and essentially just delays
sending transaction updates until the transaction is reported as durable
by the database.

For connectionless SQL operations, the setting works per-request. No SQL
syntax is provided by this patch to toggle the configuration.

After some deliberation, I opted to obtain the offset when a transaction
commits (as opposed to when it starts). This creates some mild
inconvenience, because we prevent the transaction from committing until
the corresponding subscription updates are enqueued.
The strategy is, however, more correct should we ever support weaker
isolation levels, and it is easier to document.

Follow-ups include:

- Provide SQL syntax (`SET synchronous_commit = ON` or something)
- C# and TypeScript SDKs
- Reference docs?
 

# API and ABI breaking changes

Not breaking, but adds a parameter to the subscribe and sql endpoints.


# Expected complexity level and risk

4

To the author's understanding, ordering of outbound messages is not
changed by this patch, even if there are messages that don't have a
transaction offset (such as error messages). I.e. while waiting for the
transaction offset of a message to become durable, no message enqueued
after that message will be delivered. This may not be desirable in some
cases.

The patch may contain concurrency bugs, e.g. awaiting futures that may
never resolve.


# Testing

- [x] Implemented a new test in the `module_subscription_actor` module
- [x] Added unit tests for the core logic in `ClientConnectionReceiver` 

It would be desirable to also have integration-level tests, but I'm
currently unsure how to write those without being able to control if and
when the database reports an offset as durable.

---------

Signed-off-by: Kim Altintop <kim@eagain.io>
Co-authored-by: Phoebe Goldman <phoebe@clockworklabs.io>
2025-09-08 17:51:04 +00:00
Mario Montoya 8d14efa226 Fix the smoke test so it take the server URL from the config.toml (#3227)
# Description of Changes

Closes
https://github.com/clockworklabs/SpacetimeDBPrivate/issues/1998#event-19488677475

Now the smoke test parse the `config.toml` for the correct address for
connecting.

# API and ABI breaking changes

<!-- If this is an API or ABI breaking change, please apply the
corresponding GitHub label. -->

# Expected complexity level and risk
1
# Testing

- [x] Run the smoke both on public / private
2025-09-04 20:19:44 +00:00
Zeke Foppa 86089e338f Smoketests can run against remote servers (#3012)
# Description of Changes

This enables smoketests to run against remote servers, such as maincloud
/ maincloud staging.

I also added a `--spacetime-login` param, for servers that require a
"proper" spacetime login (such as both servers above).

Usage:
```bash
python3 -m smoketests \
  --remote-server https://maincloud.staging.spacetimedb.com \
  --spacetime-login \
  -x replication # for some reason this is required, even though I swear it should be disabled by not passing `--docker`
```

# API and ABI breaking changes

None. CI only.

# Expected complexity level and risk

1

# Testing
- [x] Smoketests pass on this PR
- [x] Smoketests pass when run against maincloud staging (using the
instructions above)
- [x] Manual review to check whether I've accidentally de-fanged any
"test for negative case" tests

---------

Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-08-22 17:13:42 +00:00
Phoebe Goldman 1e3e8db9bc Database-specific Timestamp route (#2864) 2025-06-13 20:23:30 +00:00
Phoebe Goldman 0866fd39d5 Add an HTTP route to get the current Timestamp (#2850) 2025-06-09 17:26:25 +00:00
Viktor Szépe f6da9e1f5f Fix typos (#2812)
Signed-off-by: Viktor Szépe <viktor@szepe.net>
2025-06-04 16:33:32 +00:00
Kim Altintop 7f0502ecf7 Replication Smoketest Cleanups (#2675)
Co-authored-by: Shubham Mishra <shubham@clockworklabs.io>
Co-authored-by: Shubham Mishra <shivam828787@gmail.com>
2025-04-28 11:39:07 +00:00
joshua-spacetime 20e92ced5a Feature gate #[client_visibility_filter] (#2528) 2025-03-31 23:15:24 +00:00
Kim Altintop e32b00420b set names atomic (#2325)
Co-authored-by: Tyler Cloutier <cloutiertyler@aol.com>
Co-authored-by: Noa <coolreader18@gmail.com>
2025-02-28 21:59:23 +00:00
Noa 6a8375260f Refactor HTTP api to better adhere to REST guidelines (real) (#2243) 2025-02-11 02:59:45 +00:00
Noa e47a8d796f Run smoketests on windows in ci (#2129) 2025-01-16 21:43:38 +00:00
Zeke Foppa 74d191f465 CLI - Confirm before publishing to non-local servers (#2086)
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2025-01-03 21:40:03 +00:00
Noa f136670420 Directory structure impl (#1879)
Co-authored-by: Jeffrey Dallatezza <jeffreydallatezza@gmail.com>
2024-11-12 04:24:43 +00:00
Zeke Foppa 3afa1e00ad CLI - Add login show and logout (#1911)
Co-authored-by: Jeffrey Dallatezza <jeffreydallatezza@gmail.com>
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2024-10-31 18:10:07 +00:00
Zeke Foppa 61360387be CLI - Login flow (#1878)
Co-authored-by: Jeffrey Dallatezza <jeffreydallatezza@gmail.com>
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2024-10-29 20:28:45 +00:00
Tyler Cloutier fa960b3be9 Small naming fixes. Fixes database identity creation. (#1892) 2024-10-24 23:02:21 +00:00
Tyler Cloutier 83fc5c33d4 The banishment of Address (#1880)
Co-authored-by: Jeffrey Dallatezza <jeffreydallatezza@gmail.com>
2024-10-23 01:56:20 +00:00
Zeke Foppa 70ab143596 CLI - Stabilize spacetime server subcommands (#1845)
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2024-10-17 22:00:48 +00:00
Jeffrey Dallatezza 83310eb6a7 Remove email and recovery related identity endpoints (#1833) 2024-10-15 00:13:18 +00:00
james gilles 4db4c9a82e Make smoketests not log expected teardown errors (#1804) 2024-10-08 17:29:15 +00:00
Zeke Foppa 0375bcb80a CLI stabilization (#1741)
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2024-09-30 20:57:38 +00:00
Zeke Foppa 386518368d CLI - --force -> --yes/-y (#1752)
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2024-09-30 17:21:35 +00:00
Zeke Foppa e78cb7c6e7 CLI - --anon-identity -> --anonymous (#1751)
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2024-09-30 04:23:11 +00:00
Kim Altintop caaafa4d0b smoketests: Allow to skip tests requiring dotnet (#1726) 2024-09-24 17:33:07 +00:00
Noa f7ae92081f Fix flaky smoketest due to race condition in subscribe (#1656)
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2024-08-29 19:02:45 +00:00
Noa c577d509c6 Add volatile_nonatomic_schedule_immediate (#1612) 2024-08-23 18:38:07 +00:00
Zeke Foppa e5cfb1e72b Fix flaky subscription smoketests (#1536)
Co-authored-by: Zeke Foppa <github.com/bfops>
Co-authored-by: Zeke Foppa <bfops@users.noreply.github.com>
2024-07-29 18:17:28 +00:00
Zeke Foppa 3266aa4ebe CLI: Use --server and --identity args consistently instead of anonymous args (#1482)
Co-authored-by: Zeke Foppa <github.com/bfops>
2024-07-10 17:48:49 +00:00
Noa 66112bbdf0 Impl subscribe subcommand & subscription smoketests (#1343)
Signed-off-by: Kim Altintop <kim@eagain.io>
Co-authored-by: Kim Altintop <kim@eagain.io>
Co-authored-by: Mazdak Farrokhzad <twingoow@gmail.com>
2024-06-14 09:16:05 +00:00
james gilles 7c90990118 Add table smoketest + more smoketest logging (#1272)
* Add smoketest to add table without migration, currently failing

* Add more logging to smoketests, add_table_pseudomigration passing

* Fix test failing for the wrong reason
2024-05-24 17:32:36 +00:00
Zeke Foppa 8ab55d2f59 spacetime publish: Add confirmation for -c (#1038)
* [bfops/confirm-publish-clear]: spacetime publish: add confirmation for -c

* [bfops/confirm-publish-clear]: review

* [bfops/confirm-publish-clear]: review

* [bfops/confirm-publish-clear]: review

* [bfops/confirm-publish-clear]: review

* [bfops/confirm-publish-clear]: review

* [bfops/confirm-publish-clear]: rename

* [bfops/confirm-publish-clear]: review

* [bfops/confirm-publish-clear]: review

* [bfops/confirm-publish-clear]: review

* [bfops/confirm-publish-clear]: fix?

* [bfops/confirm-publish-clear]: fix smoketests

* [bfops/confirm-publish-clear]: review

* [bfops/confirm-publish-clear]: fix rest of smoketests?

---------

Co-authored-by: Zeke Foppa <github.com/bfops>
2024-05-14 16:34:20 +00:00
John Detter b275dbfee8 spacetime build uses --project-path param (#1212)
* `spacetime build` uses `--project-path` param

* Fix smoketests

* Another small fix

* Another fix

---------

Co-authored-by: John Detter <no-reply@boppygames.gg>
2024-05-09 16:56:43 +00:00
Ingvar Stepanyan 84a7f83086 Simplify C# source generator csproj (#1143)
* Simplify source generator csproj

Apparently custom scripts are no longer necessary, so removing to make maintenance simpler (noticed this while working on yet another source generator).

* Add smoketest based on Ingvar's comment, + run smoketests on Windows

* Whoops, don't mkdtemp outside of debugging

* Make smoketest sillier

* Finish up a print statement

* Revert "Make smoketest sillier"

This reverts commit 135b05b380.

* Resolve versioning issue in a non-silly, professional way.

---------

Co-authored-by: James Gilles <jameshgilles@gmail.com>
2024-04-29 17:20:22 +00:00
Noa 44c9e89879 Fail CI on smoketest failures (#1155)
* Fail CI on smoketest failures

* Fix smoketests
2024-04-25 17:49:58 +00:00
Noa 540c519002 Rewrite smoketests as python unittests (#692)
* Rewrite smoketests as python unittests

* Get all tests working and do some work on parallel unittest

* Give up on parallel unittests

* Fix CI + address comments

* Fix skip-clippy arg confusion (just use the env var)

* fix ci

* Add comments
2024-03-14 02:47:38 +00:00