Skip to content
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

Tests/relay publish #1

Merged
merged 8 commits into from
Nov 7, 2023
Merged

Tests/relay publish #1

merged 8 commits into from
Nov 7, 2023

Conversation

fbarbu15
Copy link
Collaborator

@fbarbu15 fbarbu15 commented Nov 1, 2023

First iteration of framework for interop/e2e tests:

  • start/stop waku docker nodes and connect them in a network (2 for now but can be easily extended in future iterations)
  • send and validate RPC or REST API calls
  • begin a structure for scalable test (tests <- steps <- fixtures <- libs/helpers/data)
  • ci runs via github actions
  • allure reports via github pages that contain test and docker log attachments for failing tests
  • automated linters and code formatting using pre-commit

Added only 2 basic tests for now but will extend after the initial set of reviews

Copy link

@fryorcraken fryorcraken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

Really exciting.

logger = logging.getLogger(__name__)


class RPC(BaseClient):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not spend too much time on JSON RPC because we want to deprecate it in favour of REST API.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've left it for comparison purposes. This way we can check that the REST API works the same as the old RPC protocol.

message.timestamp = int(time() * 1e9)
self.node1.send_message(message, self.test_pubsub_topic)
sleep(0.1)
get_messages_response = self.node2.get_messages(self.test_pubsub_topic)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's ok to have some test for default pubsub topic but by default, you should now use shards.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense, thanks

Copy link

@jm-clius jm-clius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great to see this progress!

@fryorcraken
Copy link

Do we intend to use @AlbertoSoutullo's new tool?

@AlbertoSoutullo
Copy link
Collaborator

Do we intend to use @AlbertoSoutullo's new tool?

We just had a meeting today about this topic. We both agreed to have two separated tools.

We will keep working on this repo for "small" tests. The main reason is to speed up the testing process as well as to be able to run these tests in a fast manner. One downside of Kubernetes is the time it takes to set up, run, and clean the runs. A test that can maybe run in 20 seconds can be a 3 o 4 minutes waiting scenario in Kubernetes.

I don't know if @fbarbu15 wants to add something but I think this pretty much summarizes what we talked in our call :)

@fbarbu15
Copy link
Collaborator Author

fbarbu15 commented Nov 7, 2023

Do we intend to use @AlbertoSoutullo's new tool?

We just had a meeting today about this topic. We both agreed to have two separated tools.

We will keep working on this repo for "small" tests. The main reason is to speed up the testing process as well as to be able to run these tests in a fast manner. One downside of Kubernetes is the time it takes to set up, run, and clean the runs. A test that can maybe run in 20 seconds can be a 3 o 4 minutes waiting scenario in Kubernetes.

I don't know if @fbarbu15 wants to add something but I think this pretty much summarizes what we talked in our call :)

Thanks. In addition to enhanced speed, opting for this method over Kubernetes provides us with greater control and predictability regarding the messages sent and the assertions we must perform. Moreover, should an issue arise, it simplifies the process of identifying the problem and reproducing it for further investigation.
However, as Alberto and I discussed, once we've addressed the simpler scenarios and begin to tackle more complex ones, Kubernetes tool will come in handy.

@fbarbu15 fbarbu15 merged commit 88b1fa3 into master Nov 7, 2023
2 checks passed
@fbarbu15 fbarbu15 deleted the tests/relay-publish branch November 7, 2023 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants