Skip to content

Commit

Permalink
[release/candidate/v0.9.0]: cherrypick #1115: Fail CI on smoketest fa…
Browse files Browse the repository at this point in the history
…ilures
  • Loading branch information
Zeke Foppa committed Apr 25, 2024
1 parent 62fb8ef commit 93cf0e5
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion smoketests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ def reset_config(cls):

def fingerprint(self):
# Fetch the server's fingerprint; required for `identity list`.
self.spacetime("server", "fingerprint", "localhost", "-f")
self.spacetime("server", "fingerprint", "-s", "localhost", "-f")

def new_identity(self, *, email, default=False):
output = self.spacetime("identity", "new", "--no-email" if email is None else f"--email={email}")
Expand Down
2 changes: 2 additions & 0 deletions smoketests/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ def main():
unittest_parallel.main(buffer=buffer, verbose=verbosity, level="class", discovered_tests=tests, jobs=args.jobs)
else:
result = unittest.TextTestRunner(buffer=buffer, verbosity=verbosity).run(tests)
if not result.wasSuccessful():
parser.exit(status=1)


if __name__ == '__main__':
Expand Down
3 changes: 2 additions & 1 deletion smoketests/tests/modules.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,10 @@ class UploadModule2(Smoketest):
spacetimedb::schedule!("100ms", my_repeating_reducer(Timestamp::now()));
}
#[spacetimedb(reducer, repeat = 100ms)]
#[spacetimedb(reducer)]
pub fn my_repeating_reducer(prev: Timestamp) {
println!("Invoked: ts={:?}, delta={:?}", Timestamp::now(), prev.elapsed());
spacetimedb::schedule!("100ms", my_repeating_reducer(Timestamp::now()));
}
"""
def test_upload_module_2(self):
Expand Down
8 changes: 4 additions & 4 deletions smoketests/tests/servers.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ def test_servers(self):
self.assertRegex(servers, re.compile(r"^\s*testnet\.spacetimedb\.com\s+https\s+testnet\s*$", re.M))
self.assertRegex(servers, re.compile(r"^\s*\*\*\*\s+127\.0\.0\.1:3000\s+http\s+localhost\s*$", re.M))

out = self.spacetime("server", "fingerprint", "127.0.0.1:3000", "-f")
out = self.spacetime("server", "fingerprint", "-s", "http://127.0.0.1:3000", "-f")
self.assertIn("No saved fingerprint for server 127.0.0.1:3000.", out)

out = self.spacetime("server", "fingerprint", "127.0.0.1:3000")
out = self.spacetime("server", "fingerprint", "-s", "http://127.0.0.1:3000")
self.assertIn("Fingerprint is unchanged for server 127.0.0.1:3000", out)

out = self.spacetime("server", "fingerprint", "localhost")
self.assertIn("Fingerprint is unchanged for server localhost", out)
out = self.spacetime("server", "fingerprint", "-s", "localhost")
self.assertIn("Fingerprint is unchanged for server localhost", out)

0 comments on commit 93cf0e5

Please sign in to comment.