Add teardown support for doc tests (#70831)

This adds named `teardown` support for doc tests similar to its support
for named `setup` section. This is useful when many doc files want to
share a similar `setup` AND `teardown`. I've introduced an example of
this in the CCR docs just to prove its works. We expect we'll use it for
datastreams as well.

Closes #70830

Co-authored-by: James Rodewig <40268737+jrodewig@users.noreply.github.com>
This commit is contained in:
Nik Everett 2021-03-24 16:57:50 -04:00 committed by GitHub
parent 2b9ed7d36f
commit 75342a2a71
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 78 additions and 29 deletions

View file

@ -1,27 +1,6 @@
[role="xpack"]
[testenv="platinum"]
//////////////////////////
[source,console]
--------------------------------------------------
PUT /follower_index/_ccr/follow?wait_for_active_shards=1
{
"remote_cluster" : "remote_cluster",
"leader_index" : "leader_index"
}
--------------------------------------------------
// TESTSETUP
// TEST[setup:remote_cluster_and_leader_index]
[source,console]
--------------------------------------------------
POST /follower_index/_ccr/pause_follow
--------------------------------------------------
// TEARDOWN
//////////////////////////
[[ccr-managing]]
=== Manage {ccr}
Use the following information to manage {ccr} tasks, such as inspecting
@ -135,6 +114,7 @@ PUT /follower_index/_ccr/follow?wait_for_active_shards=1
"leader_index" : "leader_index"
}
----------------------------------------------------------------------
// TEST[setup:remote_cluster_and_leader_index_and_follower_index teardown:pause_follow]
====
[[ccr-terminate-replication]]