Files
SpacetimeDB/smoketests/tests/energy.py
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

15 lines
368 B
Python

from .. import Smoketest, requires_anonymous_login
import time
class EnergyFlow(Smoketest):
@requires_anonymous_login
def test_energy_balance(self):
"""Test getting energy balance."""
self.new_identity()
self.publish_module()
out = self.spacetime("energy", "balance")
self.assertRegex(out, '{"balance":"-?[0-9]+"}')