You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.adoc
+86-7
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@ This repository hosts the documentation source for the Couchbase Python SDK.
13
13
14
14
== Contributing
15
15
16
-
Check out our {url-contribute}[contributing guide] to learn how to:
16
+
Check out the {url-contribute}[contributing guide] to learn how to:
17
17
18
18
* submit a bug or feedback issue
19
19
* set up your documentation workspace
@@ -27,14 +27,93 @@ Thank you for helping to make the documentation better.
27
27
This repository contains an Antora docs component.
28
28
Keep in mind these key repository features:
29
29
30
-
* Component name, version, and start page are configured in each branch's _antora.yml_ file.
31
-
* The navigation for all of the modules is stored in the ROOT module's _nav.adoc_ file.
32
-
* Production branches use the *release/X.Y* naming pattern (e.g., release/5.5, release/6.0).
30
+
* Each branch's _antora.yml_ file configures the component name, version, and start page.
31
+
* The ROOT module's _nav.adoc_ file stores the navigation for all of the modules.
32
+
* Production branches use the *release/X.Y* naming pattern (for example, release/5.5, release/6.0).
33
33
** The {url-playbook}[docs site playbook] instructs Antora to automatically aggregate any branch names that start with *release/*.
34
34
35
35
== Documentation Site Toolchain
36
36
37
-
The documentation source files are marked up with AsciiDoc.
38
-
Once merged into a version branch, the source files and their assets are aggregated, converted to HTML, and published by Antora to our staging and production sites.
39
-
The docs components and {url-ui}[site UI] are orchestrated by the {url-playbook}[docs site playbook].
37
+
The documentation source files written with AsciiDoc markup.
38
+
Once merged into a version branch Antora aggregates the source files and their assets, converts to HTML, and publishes them to the staging and production sites.
39
+
The {url-playbook}[docs site playbook] orchestrates the docs components and {url-ui}[site UI].
40
40
See the contributing guide to learn more.
41
+
42
+
== Automated Testing
43
+
44
+
This repository performs a check on the sample code upon opening a Pull Request.
45
+
These tests need to succeed to perform the merge.
46
+
47
+
=== Test Framework Structure
48
+
49
+
image::TestInfra.png[]
50
+
51
+
The following steps conduct the check:
52
+
53
+
1. The user opens a PR, triggering the GitHub Action
54
+
2. The action creates a GitHub runner VM, and copies the repository over
55
+
3. The runner starts the Docker test framework with `docker compose --profile prod up --abort-on-container-exit`. The flag is to verify the database container is also killed when the tests finish.
56
+
4. The database and SDK containers start. The following two steps occur concurrently.
57
+
** Database Container: Uses the `server/sandbox` image from Docker Hub. This image configures and starts Couchbase, setting up a one node cluster with the travel-sample bucket installed.
58
+
** SDK Container: Builds the SDK image from a debian python base image, copying the repository over, and installing dependencies. It then uses `wait-for-couchbase` to ping the Couchbase container, until it confirms the database is fully configured and running.
59
+
5. Once the SDK confirms the database is ready for tests, it runs the bats test file. Bats retries each test up to three times upon failure.
60
+
6. When the tests have completed, both the SDK and Couchbase containers should die. If they persist, such as in a case where the test framework crashes, the GitHub Action instead destroys them.
61
+
62
+
=== Testing Code Samples Locally
63
+
64
+
You may want to run tests locally if you are adding/updating a code sample.
65
+
The only prerequisites are a local copy of this repository, and https://www.docker.com/[Docker].
66
+
You can start the local test environment by running the following command:
67
+
68
+
[source, console]
69
+
----
70
+
docker compose --profile local up
71
+
----
72
+
73
+
This creates two Docker containers with the same structure as described in <<Test Framework Structure>>, with the following changes:
74
+
75
+
* The bats tests aren't automatically performed once Couchbase has finished configuring
76
+
* The repository files in the container mount onto the SDK repository in your local machine.
77
+
This means any changes you make to the files on your local machine are instantly reflected in the container.
0 commit comments