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

CLI testing #4

Closed
wants to merge 5 commits into from
Closed

CLI testing #4

wants to merge 5 commits into from

Conversation

juan518munoz
Copy link

@juan518munoz juan518munoz commented Nov 24, 2023

Implement CLI testing following this guide with escargot to use select features.

@juan518munoz
Copy link
Author

test_cli_create_account_works hangs if the database is clean, testing seems to work only if the command is ran manually at least once before running the test.

Copy link
Collaborator

@igamigo igamigo left a comment

Choose a reason for hiding this comment

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

It would be nice to know why the tests hang if there is a clean DB. Maybe because both commands are executed and they lock on table creation? I think it's possible to make them run sequentially with the crate serial_test (although we don't want to use that besides just testing this problem). An alternative is to run tests with --test-threads 1 although this only reduces concurrency.

Cargo.toml Outdated
Comment on lines 31 to 33
assert_cmd = "2.0.12"
predicates = "3.0.4"
escargot = "0.5.8"
Copy link
Collaborator

Choose a reason for hiding this comment

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

As we discussed offline, if it's easy to work around, let's try to remove crates or try to make sure they are no_std compatible. If there is no good alternative, it's fine to add them for now.

Copy link
Author

Choose a reason for hiding this comment

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

assert_cmd doesn't support running with features, using escargot seems mandatory, nevertheless, it is no std compatible.

Cargo.toml Show resolved Hide resolved
@juan518munoz
Copy link
Author

It would be nice to know why the tests hang if there is a clean DB. Maybe because both commands are executed and they lock on table creation? I think it's possible to make them run sequentially with the crate serial_test (although we don't want to use that besides just testing this problem). An alternative is to run tests with --test-threads 1 although this only reduces concurrency.

Testing further (being more patient) I've found thath it doesn't really hang, it just takes about a minute to complete, running with a limited thread count takes the same amount of time.

@juan518munoz juan518munoz deleted the cli-testing branch December 12, 2023 14:03
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.

2 participants