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

Connor/cli smoke test #1196

Merged
merged 32 commits into from
Aug 6, 2021
Merged

Connor/cli smoke test #1196

merged 32 commits into from
Aug 6, 2021

Conversation

connormullett
Copy link
Contributor

Summary of changes
Changes introduced in this pull request:

  • Adds a smoke test script and documentation on how to run it and requirements to do so.

Reference issue to close (if applicable)

Closes
#1040

Other information and links

Comment on lines 4 to 10
## Prerequisites
In order to smoke test the RPC API endpoints, you need to meet 2 pre-requisites.
* A forest node should be running locally on port `1234`
* `FULLNODE_API_INFO` needs to be set as an environment variable. This can be done
as a prefix to the actual command, set with a script that is sourced (linux),
or set via the command line. If you don't know the multiaddr of the node, you can
use `forest auth api-info` to get the key-value pair needed.
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think of creating a temporary config in /tmp and then use the new FOREST_CONFIG env var to disable keystore encryption? Then all these commands should work automatically, no FULLNODE_API_INFO variable needed. The new changes in the last api-info PR made it so the keystore is unlocked without necessarily needing that anymore, unless you're testing with different permissions levels.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I like it, let me see if I can wrangle something like that together. Currently permissions are not being tested. These smoke tests are just testing if the endpoints can be hit and a response is returned.

Copy link
Contributor

Choose a reason for hiding this comment

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

Cool! And yeah, it's fine to not test permissions for a first stab at this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Smoke tests should not test permissions. If we want to test permissions we should set up some auth testing which would be similar to integration tests

Copy link
Contributor

Choose a reason for hiding this comment

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

Honestly, I'm not sure there's a decent way to do a comprehensive evaluation beyond a basic validation of the auth mechanism itself since the Lotus OpenRPC schema doesn't specify permissions.

I do think auth levels should be verified against at least one endpoint through smoke tests, but I'm fine with you implementing that later or some other way.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Implemented the requested changes. Should be ready now

Copy link
Contributor

Choose a reason for hiding this comment

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

Cool, I'll give it another look

Copy link
Contributor

Choose a reason for hiding this comment

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

@connormullett Also, can you update the docs for this? I don't think we need the env variable now, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right, we don't need that anymore. Good catch!

@@ -128,7 +128,6 @@ where
.with_method(STATE_REPLAY, state_replay::<DB, B>)
.with_method(STATE_NETWORK_NAME, state_network_name::<DB, B>)
.with_method(STATE_NETWORK_VERSION, state_get_network_version::<DB, B>)
.with_method(STATE_REPLAY, state_replay::<DB, B>)
Copy link
Member

Choose a reason for hiding this comment

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

Why was this removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Umm, IDK? Might have misclicked something

Copy link
Contributor

@cryptoquick cryptoquick left a comment

Choose a reason for hiding this comment

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

Alright, this is good enough for a smoke test. I really look forward to when we can add proper integration tests, though. Thanks for your work!

@connormullett connormullett merged commit bf3936a into main Aug 6, 2021
@connormullett connormullett deleted the connor/cli-smoke-test branch August 6, 2021 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants