-
Notifications
You must be signed in to change notification settings - Fork 593
Smoketests can run against remote servers #3012
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
d40b7d9
8d30ed7
e8b675a
fdea829
33c6aec
8d878fe
3be768a
76682ed
bb36753
ee88748
8d7596c
2e8dff7
94abcae
52c87f0
06beeb4
891825b
57a6762
548c075
9d86c52
ef755aa
f7eb981
cd2aa0b
3b5362c
f3d292a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
default_server = "127.0.0.1:3000" | ||
default_server = "localhost" | ||
spacetimedb_token = "eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiJ9.eyJoZXhfaWRlbnRpdHkiOiJjMjAwYzc3NDY1NTE5MDM2MTE4M2JiNjFmMWMxYzY3NDUzMzYzY2MxMTY4MmM1NTUwNWZiNjdlYzI0ZWMyMWViIiwic3ViIjoiOTJlMmNkOGQtNTk5Ny00NjZlLWIwNmYtZDNjOGQ1NzU3ODI4IiwiaXNzIjoibG9jYWxob3N0IiwiYXVkIjpbInNwYWNldGltZWRiIl0sImlhdCI6MTc1MjA0NjgwMCwiZXhwIjpudWxsfQ.dgefoxC7eCOONVUufu2JTVFo9876zQ4Mqwm0ivZ0PQK7Hacm3Ip_xqyav4bilZ0vIEf8IM8AB0_xawk8WcbvMg" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. instead of using a hardcoded address, use a nickname for the server specified below. This allows us to look up the correct |
||
|
||
[[server_configs]] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,8 +10,6 @@ def setUp(self): | |
def test_call(self): | ||
"""Ensure that anyone has the permission to call any standard reducer""" | ||
|
||
self.new_identity() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't believe this |
||
|
||
self.publish_module() | ||
|
||
self.call("say_hello", anon=True) | ||
|
@@ -21,28 +19,22 @@ def test_call(self): | |
def test_delete(self): | ||
"""Ensure that you cannot delete a database that you do not own""" | ||
|
||
self.new_identity() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't believe this |
||
|
||
self.publish_module() | ||
|
||
self.reset_config() | ||
self.new_identity() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the goal of the |
||
with self.assertRaises(Exception): | ||
self.spacetime("delete", self.database_identity) | ||
|
||
def test_describe(self): | ||
"""Ensure that anyone can describe any database""" | ||
|
||
self.new_identity() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't believe this |
||
self.publish_module() | ||
|
||
self.reset_config() | ||
self.new_identity() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. removed these in favor of just using |
||
self.spacetime("describe", "--json", self.database_identity) | ||
self.spacetime("describe", "--anonymous", "--json", self.database_identity) | ||
|
||
def test_logs(self): | ||
"""Ensure that we are not able to view the logs of a module that we don't have permission to view""" | ||
|
||
self.new_identity() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't believe this |
||
self.publish_module() | ||
|
||
self.reset_config() | ||
|
@@ -57,10 +49,9 @@ def test_logs(self): | |
def test_publish(self): | ||
"""This test checks to make sure that you cannot publish to an identity that you do not own.""" | ||
|
||
self.new_identity() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't believe this |
||
self.publish_module() | ||
|
||
self.reset_config() | ||
self.new_identity() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the goal of this |
||
|
||
with self.assertRaises(Exception): | ||
# TODO: This raises for the wrong reason - `--clear-database` doesn't exist anymore! | ||
|
@@ -73,11 +64,10 @@ def test_publish(self): | |
def test_replace_names(self): | ||
"""Test that you can't replace names of a database you don't own""" | ||
|
||
self.new_identity() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't believe this |
||
name = random_string() | ||
self.publish_module(name) | ||
|
||
self.reset_config() | ||
self.new_identity() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the goal of this |
||
|
||
with self.assertRaises(Exception): | ||
self.api_call( | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -229,6 +229,7 @@ def tearDown(self): | |
self.docker.compose("up", "-d") | ||
super().tearDown() | ||
|
||
# TODO: This function seems to run even when `--docker` is not passed, leading to errors unless `-x replication` is passed, due to the docker-related code below. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. pretty unrelated, but I ran into this while testing |
||
def __init__(self, *args, **kwargs): | ||
super().__init__(*args, **kwargs) | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this corresponds to the change to the
config.toml
below; now thedefault_server
is expected to be a server nickname instead of a hostname. This allows us to 1) avoid duplicating the hostname whenever we want to update it, and 2) look up the protocol associated with this hostname (which we previously didn't have a way of providing).