-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Make ct a behaviour for test suites (original by richcarl) #2794
Make ct a behaviour for test suites (original by richcarl) #2794
Conversation
OK, so here's the story:
|
I proceeded to:
|
What's missing: Edit: all of these moved to the main description element. |
Could you guide me as per the questions in #2794 (comment)? Thanks. |
You can look at gen_statem and ssh_server_channel as examples of callback behaviours documentation using specs. Some of the documentation in the common_test module (that is the current documentation of a test suite callbacks) is of course relevant but it can be improved and better structured with help of the usage of specs to generate parts of the documentation. |
Thank you, @IngelaAndin. Can I assume that:
About testing |
@IngelaAndin, do you think it would be OK to document the Data Types in common_test.html, like dict.html does, for example? The main difference is that:
Probably we could document this in the "header" but I see no example like it in the source docs. |
Can I assume that:
Yes
Our policy is to be restrictive with exporting types. Only input and return types should be necessary to export.
I think that might still be up for discussion, but it will be simpler to discuss it when we have a built documentation proposal and not to difficult to change.
Yes we will accept it for maint. It does not require any special tests. It might be challenging to apply it to all OTP test suites as there might still be legacy things |
When it comes to the data types, they should be documented in the same fashion as in dict, this you should get almost for free when using specs to generate the docs. We usually put the spec in the relevant Erlang file an not in a a header file. So you can export the relevant types from ct_suite.erl The common_test.xml should not have any documentation for the callbacks this The xml will need something like this (a not full lexample from ssl.xml) :
|
How do you use "specs to generate the docs"? I'm used to
|
I'm a bit confused here, since there's no I think for the doc. to be clear:
|
57f3963
to
584cc4f
Compare
We do not use edoc. We want you to create a manual page ct_suite.xml that includes the data types and documentation for the ct_suite behaviour. The xml from code above refers to data types exported from ssl.erl and creates the datatype part of the manual page. You can refer to types with seetype: (examle from gen_statem)
Alas I do not think it is publicly documented at the moment. If we should remove common_test.xml or perhaps replace it with common_test_app.xml is an other issue. I think we can address that once we are getting ct_suite.xml in place. |
Hm... OK. I made some changes to |
The documentation existing of the callback API today in common_test.xml is not at all in a place that we usually would expect it to be. I think it has some legacy reasons for being so. The origin of common_test was a very non common test framework that ended up becoming a common test framework replacing the old OTP test framework, instead of being used for an other not so common use case. I think the relevant part should be moved to ct_suite.xml |
Hadn't understood this.
Sure, that's why I included that in the initial description. In any case I made the changes in the existing man page so it's easier to validate once I copy-paste them (since I will mostly copy-paste). |
I tried to address all documentation issues in the most recent commits: I'm still unable to generate the documentation locally (keep getting |
I'm looking into this again (thanks, @IngelaAndin, will try your fix in a minute). I hope there's no conflict (since macOS in case-insensitive for filenames) between |
(trying to have `make test` working)
Thanks for the help. I hope 6fbd047 does it. It's not quite what you wrote, but I assume you assumed I hadn't created an issue before (which I might have - and which, hopefully, this commit fixes). |
@IngelaAndin: regarding "some types aren't linked, like e.g.
shouldn't have references to type |
I solved the compilation issues, along with the test issues. |
After this, I'd like to know if you feel there's something missing. |
The documentation still does not build, some links needs fixing. If you do |
We are aware that you can not currently see which types are exported and hence may be refereed to in other specs and which are only sub types that are for documentation purposes. There is no obvious solution at the moment, time will tell but this is as you say an other issue than the one of this PR. |
I kind of hacked a solution for this:
|
I'll do this :) I just keep piling up issues haha. (shouldn't the build process, locally, complain about that, though?) |
I think it is the link checker that finds the problem, so it is a later step. |
If only there was a Is anything missing, @IngelaAndin? I want to help further if further help is required. |
@peterdmv, is there something missing that I can do, still? |
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.
Had an open review (by mistake). Tried to post something to delete it afterward; couldn't. Sorry about the noise.
Thanks for this and your guidance. |
This PR is related to #2000 (I used the same title and all), and continues from #2000 (comment).