-
-
Notifications
You must be signed in to change notification settings - Fork 331
Update testing intro doc #4735
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?
Update testing intro doc #4735
Conversation
Signed-off-by: Mats Wichmann <[email protected]>
the unit tests for the ``Builder.py`` module are in the | ||
``BuilderTests.py`` script. Unit tests tend to be based on assertions. | ||
``SCons/`` subdirectory (that is alongside the code they are testing) | ||
and use the Python ``unittest`` module to perform assertion-based |
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.
Should include that files have to be named *Tests.py to be found.
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 thought that's what that section was saying?
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 don't see it in this section.. it's much later in the doc..
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'm not seeing the reason for the fuss here. This is an "about" section, not a "how to" section. I can add these but it seems like extra noise.
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.
You removed it from the original, which I think is useful information to have up front.
testing/framework/test-framework.rst
Outdated
run by calling ``scons`` (or in a few cases, ``sconsign`` or ``scons-time``) | ||
to execute them, and thus capture the results of | ||
running all the way through an invocation - end to end. | ||
They are implemented as Python scripts which are responsible for setup, |
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.
Must have the .py suffix.
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.
It says that clearly somewhere... line 112 in the current copy after I hunt for it.
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.
better to duplicate than to mention this bit here and that bit only later.
testing/framework/test-framework.rst
Outdated
a reproducer are by their nature more like an e2e test - this is something | ||
a user has tried in their SConscripts that didn't have the expected result. | ||
End-to-end tests exist to verify hardened parts of the public interface: | ||
featurers documented in the reference manual that are available |
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.
typo "featurers" -> features.
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.
fixing.
testing/framework/test-framework.rst
Outdated
("I put this in my SConscripts, and something went wrong"), | ||
so it's often useful to code an e2e test to match a bug report, | ||
and develop a solution that turns that to a pass. | ||
So pick the testing strategy that makes sense (sometimes both do). |
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.
And if it's possible to reduce an end-to-end test to a unit test, please do.
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'll add that but I'm not sure that's always the preference, I think it's context-dependent.
testing/framework/test-framework.rst
Outdated
|
||
|
||
Testing Architecture | ||
==================== | ||
|
||
The test framework provides a lot of useful functions for use within a | ||
test program. This includes test setup, parameterization, running tests, | ||
looking at results and reporting outcomes. You can run a particular test | ||
examining results and reporting outcomes. You can run a particular test |
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.
Does this work for end-to-end tests? I thought it was only unit 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.
You're right, it doesn't - I thought it did. It doesn't find the SCons instance properly. Possible that could be fiddled too, but I'll get rid of the implication.
testing/framework/test-framework.rst
Outdated
tells ``runtest.py`` to skip the contents of the directory completely. | ||
#. Create a file ``.exclude_tests`` in each directory in question, and in | ||
it list line-by-line the files to exclude from testing. | ||
* Create a file ``.exclude_tests`` in yur subdirectory, and in |
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.
yur => your
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.
or "ur"? :-)
testing/framework/test-framework.rst
Outdated
Sometimes other Python modules are necessary or helpful, and get | ||
imported before this line. | ||
If you need Python standard library modules in your code, | ||
the conventio it to import those before the framework. |
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.
conventio -> convention
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.
Fixing.
Signed-off-by: Mats Wichmann <[email protected]>
Signed-off-by: Mats Wichmann <[email protected]>
This does not affect SCons at all - only updates the document (which is eventually duplicated on the Wiki) about making use of the SCons test framework.
It's not going to be easy to review in the classical way, maybe just scan through the full doc and see if it makes sense this way?
https://scons.org/guidelines.html
Contributor Checklist:
CHANGES.txt
andRELEASE.txt
(and read theREADME.rst
).