-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
doc: add document for testing with seastar #2407
Conversation
doc/testing.md
Outdated
@@ -0,0 +1,51 @@ | |||
# Testing | |||
|
|||
Seastar leverages Boost.Test and provides facilitiets for developers to implement tests in coroutines. |
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.
I suggest running aspell check
on this file; here: s/facilitiets/facilities/
.
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.
yeah, Benny suggested the similar before. =( i will try M-x flyspell-buffer next time.
doc/testing.md
Outdated
|
||
Seastar leverages Boost.Test and provides facilitiets for developers to implement tests in coroutines. | ||
|
||
## Tests Declaration |
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.
I'd rather write Test Declarations
or Declaring Tests
.
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.
i'd go with "Test Declarations" to be more consistent with the titles of the same level.
doc/testing.md
Outdated
|
||
* Boost.Test Native: Tests defined using `BOOST_AUTO_TEST_CASE` and related macros from Boost.Test. For more information, see the [Boost Test documentation](https://www.boost.org/doc/libs/release/libs/test/doc/html/boost_test/utf_reference/test_org_reference.html). | ||
* Coroutine: Tests defined using `SEASTAR_TEST_CASE`. The test body returns a future, allowing implementation as a coroutine. | ||
* Coroutine with `seastar::thread`: Tests defined using `SEASTAR_THREAD_TEST_CASE`. The test body is launched in a Seastar thread, allowing the use of Seastar coroutines. These tests should return `void`. |
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.
The link to the Boost.Test documentation is helpful; can we do the same with the other two kinds of tests?
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.
sure. added the hyper links.
doc/testing.md
Outdated
* For Seastar facilities that don't depend on coroutines, consider using `BOOST_AUTO_TEST_CASE`. | ||
|
||
|
||
## Tests organization |
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.
Tests' Organization
or Organizing Tests
look more correct IMO.
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.
i picked the former.
doc/testing.md
Outdated
|
||
## Tests organization | ||
|
||
* Tests defined with `BOOST_AUTO_TEST_CASE` are driven by Boost.Test's built-in test runner. They require defining `BOOST_TEST_MODULE` to include the runner in the executable. These tests support additional features like fixtures and data-driven testing. |
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.
Might want to mention that the replacement list for the BOOST_TEST_MODULE
macro is supposed to be the "name of the master test suite".
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.
i am adding a hyper link to Boost.Test's document. it should do a better job than i do in this regard.
since Boost.Test does not provide builtin support for testing test cases implemented with coroutine. we have our own test runner and macros for declaring tests. for new developers these macros and the macros like `BOOST_AUTO_TEST_CASE` could be confusing. this document intend to clarify the declaration and organization of tests in Seastar and Seastar applications using Seastar's testing framework. Signed-off-by: Kefu Chai <[email protected]>
v2:
|
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.
Thanks for putting up with my hair-splitting; looks great!
since Boost.Test does not provide builtin support for testing test cases implemented with coroutine. we have our own test runner and macros for declaring tests. for new developers these macros and the macros like `BOOST_AUTO_TEST_CASE` could be confusing. this document intend to clarify the declaration and organization of tests in Seastar and Seastar applications using Seastar's testing framework. Signed-off-by: Kefu Chai <[email protected]> Closes scylladb#2407
since Boost.Test does not provide builtin support for testing test cases implemented with coroutine. we have our own test runner and macros for declaring tests. for new developers these macros and the macros like
BOOST_AUTO_TEST_CASE
could be confusing.this document intend to clarify the declaration and organization of tests in Seastar and Seastar applications using Seastar's testing framework.