Closed RituRajSingh878 closed 3 years ago
Is the ask here to run Python examples as part of CI? I don't understand the issue with ipython? If there are two issues, please open them separately so they can be tracked easier.
It would be great to run the example test on Cl. Also, I am saying for the developer if we have some command for testing on a local machine it will be great. And with that command, we can test the test file and the example present in the code.
This may be related https://www.sphinx-doc.org/en/master/usage/extensions/doctest.html
So the feature request is to be able to test that examples in documentation are valid as part of CI?
So the feature request is to be able to test that examples in documentation are valid as part of CI?
yes
You have opened a pr for the running doc on cl for every commits. After your pr, I will add the doc8 style check for the doc(I will learn about this as I am not familiar with cl).
What is checked:
- invalid rst format - D000
- lines should not be longer than 79 characters - D001
- RST exception: line with no whitespace except in the beginning
- RST exception: lines with http or https urls
- RST exception: literal blocks
- RST exception: rst target directives
- no trailing whitespace - D002
- no tabulation for indentation - D003
- no carriage returns (use unix newlines) - D004
- no newline at end of file - D005
The CI I have created is for documentation general, not to enforce requirements on them. That should be done as part of PR validation.
Can I add doc8 checks here? https://github.com/VowpalWabbit/vowpal_wabbit/blob/master/build-linux.sh
I am opening this issue for the implementation of scripts so that we can run the test directly by some command(maybe
vw runalltest
)and in this test, it should run the example test as well as the test file. (Currently we can't test examples by this commandpython -m pytest ./python/tests/
) example test - https://github.com/VowpalWabbit/vowpal_wabbit/blob/bcd47ad60dabba63504b6fd8c691b20f1624caf5/python/vowpalwabbit/sklearn_vw.py#L697We are adding an example test in the code for understanding purposes. Still, it can also be helpful to test the code by addition of unit tests so any user can understand the code easily, and also any developer can understand the code and its usage. It will be helpful in the dubbing or addition of the code because we can see that what we are loosing from the addition/removal of the code by running the test and checking its failing. The example test is more specific about that function or the class in which it is defined so it will be helpful for the above issues.
I will make a pr for the same after the discussion.