-
Notifications
You must be signed in to change notification settings - Fork 24.8k
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
Missing rest specs for testing features' code snippets #48663
Comments
Pinging @elastic/es-core-infra (:Core/Infra/Build) |
Per @droberts195: We have cleanup code both for the X-Pack REST tests [1] and the (Apache 2 license) HLRC tests [2]. The docs tests in the x-pack/docs directory already use the X-Pack ML REST test cleaner, because XDocsClientYamlTestSuiteIT extends XPackRestIT [3] and that uses the MlRestTestStateCleaner. The only ML cleanup for the main docs directory tests is to wait for pending tasks [4]. So ironically the x-pack/docs tests are doing ML cleanup after each test (don’t worry - it should be very fast when there are no ML jobs) whereas the tests of the directory where the ML documentation actually lives are not. One way we could solve both the cleanup problem and the spec problem would be to move all the ML docs into the x-pack/docs directory...The other way would be to either duplicate the HLRC ML cleanup class into the docs test code or put it somewhere where both sets of tests can use it... [1] https://github.com/elastic/elasticsearch/blob/master/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/ml/integration/MlRestTestStateCleaner.java#L19 |
Pinging @elastic/es-docs (:Docs) |
@lcawl Does this continue to be a problem? I think with the change to remove the OSS distribution this simplifies things a bit WRT to testing as we no longer will have the notion of "OSS" docs. @jakelandis on a related point, I wonder to what degree we can simplify the distinction between "oss" and "x-pack" for REST API specs in generally, given that the default distribution is now the only one that will exist 🤔 |
I haven't tried removing them lately, but I still see "raw" methods in the build.gradle, such as elasticsearch/docs/build.gradle Line 762 in 974c9aa
|
@mark-vieira - It would be great to simply move the x-pack specs (
and change it to
There are probably a couple edge cases...but that would be the primary change for ES. The restResources are essentially 2 buckets of files, and this would allow us to simply remove one of the buckets (the test buckets would remain unchanged). This would likely break the client's team since they rely on the the directory structure. Additionally the artifact that we publish would now include the x-pack specs, so not sure if there are licensing concerns there. We also support project specific API's (specs), but I think there is only 1 project (
@lcawl - I think you should be able to change the configuration from:
to
To bring in all the x-pack specs into docs/build.gradle. This would only put the specs on the classpath, but it doesn't influence the test setup/cleanup. |
@jakelandis that's pretty much what I was thinking. |
Pinging @elastic/es-delivery (Team:Delivery) |
The docs/build.gradle that we use for code snippet testing doesn't seem to parse all the X-Pack API specs. For example, in #44018 we received:
We have worked around this for rollups and for a handful of ML APIs by using "raw" methods in the build.gradle file. For example: #48259
Instead of implementing these work-arounds, however, it would be preferable to have all the rest specs recognized by the documentation tests.
The text was updated successfully, but these errors were encountered: