33Integration Tests using Teuthology Workflow
44===========================================
55
6- Scheduling Test Run
7- -------------------
6+ Infrastructure
7+ --------------
8+
9+ Components:
10+
11+ 1. `ceph-ci `_: Clone of the main Ceph repository, used for triggering Jenkins
12+ Ceph builds for development.
13+
14+ 2. `Ceph Jenkins `_: Responsible for triggering builds, uploading packages
15+ to Chacra, and pushing updates about the build to Shaman.
16+
17+ 3. `Shaman `_: UI Interface used to check build status. In its backend,
18+ it is a REST API to query and store build information.
19+
20+ 4. `Chacra `_: Service where packages are uploaded. The binaries uploaded
21+ here can be downloaded and used by anyone.
22+
23+ 5. `Teuthology CLI `_: Developers can use various Teuthology commands to schedule
24+ and manage test runs.
25+
26+ 6. Teuthology: This component is responsible for pushing test jobs to
27+ the Beanstalk queue and Paddles. It also picks jobs from
28+ the queue and runs tests.
29+
30+ 7. Beanstalk queue: A priority queue containing all the queued jobs.
31+ Developers typically do not need to interact with it.
32+
33+ 8. Paddles: A backend service that stores all test run information.
34+ Developers typically do not need to interact with it.
35+
36+ 9. `Pulpito `_: A UI interface (for information stored in Paddles) that allows
37+ developers to see detailed information about their scheduled tests,
38+ including status and results.
39+
40+ 10. Testnodes: A cluster of various machines that are used for running tests.
41+ Developers usually schedule tests to run on `smithi `_ machines, which are
42+ dedicated test nodes for Teuthology integration testing.
43+
44+ Each Teuthology test *run * contains multiple test *jobs *. Each job runs in an
45+ environment isolated from other jobs, on a different collection of test nodes.
46+
47+ To test a change in Ceph, follow these steps:
48+
49+ 1. Getting binaries - Build Ceph.
50+ 2. Scheduling Test Run:
51+
52+ a. About Test Suites.
53+ b. Triggering Teuthology Tests.
54+ c. Testing QA changes (without re-building binaries).
55+ d. Filtering Tests.
856
9- Getting binaries
10- ****************
57+ 3. Viewing Test Results:
58+
59+ a. Pulpito Dashboard.
60+ b. Teuthology Archives (Reviewing Logs).
61+
62+ 4. Killing tests.
63+ 5. Re-running tests.
64+
65+
66+ Getting binaries - Build Ceph
67+ -----------------------------
1168
1269Ceph binaries must be built for your branch before you can use teuthology to run integration tests on them. Follow these steps to build the Ceph binaries:
1370
@@ -41,8 +98,44 @@ Ceph binaries must be built for your branch before you can use teuthology to run
4198.. _the Chacra site : https://shaman.ceph.com/api/search/?status=ready&project=ceph
4299
43100
44- Triggering Tests
45- ****************
101+ Naming the ceph-ci branch
102+ *************************
103+ Prepend your branch with your name before you push it to ceph-ci. For example,
104+ a branch named ``feature-x `` should be named ``wip-$yourname-feature-x ``, where
105+ ``$yourname `` is replaced with your name. Identifying your branch with your
106+ name makes your branch easily findable on Shaman and Pulpito.
107+
108+ If you are using one of the stable branches (`quincy `, `pacific `, etc.), include
109+ the name of that stable branch in your ceph-ci branch name.
110+ For example, the ``feature-x `` PR branch should be named
111+ ``wip-feature-x-nautilus ``. *This is not just a convention. This ensures that your branch is built in the correct environment. *
112+
113+ You can choose to only trigger a CentOS 9.Stream build (excluding other distro like ubuntu)
114+ by adding "centos9-only" at the end of the ceph-ci branch name. For example,
115+ ``wip-$yourname-feature-centos9-only ``. This helps to get quicker builds and save resources
116+ when you don't require binaries for other distros.
117+
118+ Delete the branch from ceph-ci when you no longer need it. If you are
119+ logged in to GitHub, all your branches on ceph-ci can be found here:
120+ https://github.com/ceph/ceph-ci/branches.
121+
122+
123+ Scheduling Test Run
124+ -------------------
125+
126+ About Test Suites
127+ *****************
128+
129+ Integration tests are organized into “suites”, which are defined in ``qa/suites ``
130+ sub-directory of the Ceph repository. These test suites can be run with the teuthology-suite
131+ command.
132+
133+ See `Suites Inventory `_ for a list of available suites of integration tests.
134+
135+ More details understanding of how these test suites are defined can be found on `Integration Test Introduction Page `_.
136+
137+ Triggering Teuthology Tests
138+ ***************************
46139
47140After you have built Ceph binaries for your branch, you can run tests using
48141teuthology. This procedure explains how to run tests using teuthology.
@@ -54,7 +147,10 @@ teuthology. This procedure explains how to run tests using teuthology.
54147 ssh <username>@teuthology.front.sepia.ceph.com
55148
56149 This requires Sepia lab access. To request access to the Sepia lab, see:
57- https://ceph.github.io/sepia/adding_users/
150+ https://ceph.github.io/sepia/adding_users/.
151+
152+ #. For initial setup, follow `teuthology installation guide `_ to setup teuthology for
153+ your user on teuthology machine. This will enable you to run teuthology commands.
58154
59155#. Run the ``teuthology-suite `` command:
60156
@@ -66,7 +162,7 @@ teuthology. This procedure explains how to run tests using teuthology.
66162 -s fs \
67163 -p 110 \
68164 --filter "cephfs-shell" \
69- 165+ 70166
71167 The options in the above command are defined here:
72168
@@ -101,10 +197,13 @@ teuthology. This procedure explains how to run tests using teuthology.
101197 `Pulpito `_ where the test results can be viewed.
102198
103199
200+ The ``--dry-run `` option allows you to demo-run ``teuthology-suite `` command without
201+ actually scheduling teuthology tests. This is helpful to check how many jobs and which jobs
202+ a command will schedule.
104203
105204Other frequently used/useful options are ``-d `` (or ``--distro ``),
106- ``--distroversion ``, ``--filter-out ``, ``--timeout ``, ``flavor ``, ``-rerun ``,
107- ``-l `` (for limiting number of jobs) , ``-N `` (for how many times the job will
205+ ``--distro-version ``, ``--filter-out ``, ``--timeout ``, ``flavor ``, ``- -rerun ``,
206+ ``--limit `` (for limiting number of jobs) , ``-N `` (for how many times the job will
108207run), and ``--subset `` (used to reduce the number of tests that are triggered). Run
109208``teuthology-suite --help `` to read descriptions of these and other options.
110209
@@ -159,15 +258,15 @@ job config printed at the beginning of the teuthology job.
159258 for the builds to finish, then triggering tests and waiting for
160259 the test results.
161260
162- About Suites and Filters
163- ************************
164-
165- See `Suites Inventory `_ for a list of available suites of integration tests.
166- Each directory under ``qa/suites `` in the Ceph repository is an integration
167- test suite, and arguments appropriate to follow ``-s `` can be found there.
261+ Filtering Tests
262+ ***************
168263
264+ Test suites includes combinations of many yaml files which can results in massive
265+ amount of jobs being scheduled for a suite. So filters can help to reduce the amount
266+ of jobs or schedule particular jobs within a suite.
267+
169268Keywords for filtering tests can be found in
170- ``qa/suites/<suite-name>/<subsuite-name>/tasks `` and can be used as arguments
269+ ``qa/suites/<suite-name>/<subsuite-name>/tasks `` in Ceph repository and can be used as arguments
171270for ``--filter ``. Each YAML file in that directory can trigger tests; using the
172271name of the file without its filename extension as an argument to the
173272``--filter `` triggers those tests.
@@ -182,6 +281,8 @@ contents of the file for the ``modules`` attribute. For ``cephfs-shell.yaml``
182281the ``modules `` attribute is ``tasks.cephfs.test_cephfs_shell ``. This means
183282that it triggers all tests in ``qa/tasks/cephfs/test_cephfs_shell.py ``.
184283
284+ Read more about how to `Filter Tests by their Description `_.
285+
185286Viewing Test Results
186287---------------------
187288
@@ -195,22 +296,26 @@ Teuthology Archives
195296*******************
196297
197298After the tests have finished running, the log for the job can be obtained by
198- clicking on the job ID at the Pulpito page associated with your tests. It's
299+ clicking on the job ID at the Pulpito run page associated with your tests. It's
199300more convenient to download the log and then view it rather than viewing it in
200- an internet browser since these logs can easily be up to 1 GB in size. It is
201- easier to ssh into the teuthology machine (``teuthology.front.sepia.ceph.com ``)
202- and access the following path::
301+ an internet browser since these logs can easily be up to 1 GB in size.
302+ It is also possible to ssh into a `developer playground machine `_ and access the following path::
203303
204- /ceph/ teuthology-archive/<test-id >/<job-id>/teuthology.log
304+ /teuthology/<run-name >/<job-id>/teuthology.log
205305
206306For example: for the above test ID, the path is::
207307
208- /ceph/ teuthology-archive /teuthology-2019-12-10_05:00:03-smoke-master-testing-basic-smithi/4588482/teuthology.log
308+ /teuthology/teuthology-2019-12-10_05:00:03-smoke-master-testing-basic-smithi/4588482/teuthology.log
209309
210310This method can be used to view the log more quickly than would be possible through a browser.
211311
212- In addition to ``teuthology.log ``, some other files are included for debugging
213- purposes:
312+ To view ceph logs (cephadm, ceph monitors, ceph-mgr, etc) or system logs,
313+ remove ``teuthology.log `` from the job's teuthology log url on browser and then navigate
314+ to ``remote/<machine>/log/ ``. System logs can be found at ``remote/<machine>/syslog/ ``.
315+ Similarly, these logs can be found on developer playground machines at
316+ ``/teuthology/<test-id>/<job-id>/remote/<machine>/ ``.
317+
318+ Some other files that are included for debugging purposes:
214319
215320* ``unit_test_summary.yaml ``: Provides a summary of all unit test failures.
216321 Generated (optionally) when the ``unit_test_scan `` configuration option is
@@ -219,7 +324,7 @@ purposes:
219324* ``valgrind.yaml ``: Summarizes any Valgrind errors that may occur.
220325
221326.. note :: To access archives more conveniently, ``/a/`` has been symbolically
222- linked to ``/ceph/ teuthology-archive / ``. For instance, to access the previous
327+ linked to ``/teuthology/ ``. For instance, to access the previous
223328 example, we can use something like::
224329
225330 /a/teuthology-2019-12-10_05:00:03-smoke-master-testing-basic-smithi/4588482/teuthology.log
@@ -234,9 +339,9 @@ Here is the command that terminates jobs:
234339
235340.. prompt :: bash $
236341
237- teuthology-kill -r teuthology-2019-12-10_05:00:03-smoke-master-testing-basic-smithi
342+ teuthology-kill -p - r teuthology-2019-12-10_05:00:03-smoke-master-testing-basic-smithi -m smithi -o scheduled_teuthology@teuthology
238343
239- Let's call the argument passed to ``-r `` as test ID . It can be found
344+ The argument passed to ``-r `` is run name . It can be found
240345easily in the link to the Pulpito page for the tests you triggered. For
241346example, for the above test ID, the link is - http://pulpito.front.sepia.ceph.com/teuthology-2019-12-10_05:00:03-smoke-master-testing-basic-smithi/
242347
@@ -275,28 +380,19 @@ Following's the definition of new options introduced in this section:
275380 'waiting'. Default value: 'fail,dead'
276381 ======================= ===============================================
277382
278- Naming the ceph-ci branch
279- -------------------------
280- Prepend your branch with your name before you push it to ceph-ci. For example,
281- a branch named ``feature-x `` should be named ``wip-$yourname-feature-x ``, where
282- ``$yourname `` is replaced with your name. Identifying your branch with your
283- name makes your branch easily findable on Shaman and Pulpito.
284-
285- If you are using one of the stable branches (`quincy `, `pacific `, etc.), include
286- the name of that stable branch in your ceph-ci branch name.
287- For example, the ``feature-x `` PR branch should be named
288- ``wip-feature-x-nautilus ``. *This is not just a convention. This ensures that your branch is built in the correct environment. *
289-
290- Delete the branch from ceph-ci when you no longer need it. If you are
291- logged in to GitHub, all your branches on ceph-ci can be found here:
292- https://github.com/ceph/ceph-ci/branches.
293-
294383.. _ceph-ci : https://github.com/ceph/ceph-ci
384+ .. _Ceph Jenkins : https://jenkins.ceph.com/
385+ .. _Teuthology CLI : https://docs.ceph.com/projects/teuthology/en/latest/commands/list.html
295386.. _Chacra : https://github.com/ceph/chacra/blob/master/README.rst
296387.. _Pulpito : http://pulpito.front.sepia.ceph.com/
297388.. _Running Your First Test : ../../running-tests-locally/#running-your-first-test
298389.. _Shaman : https://shaman.ceph.com/builds/ceph/
299390.. _Suites Inventory : ../tests-integration-testing-teuthology-intro/#suites-inventory
300391.. _Testing Priority : ../tests-integration-testing-teuthology-intro/#testing-priority
301392.. _Triggering Tests : ../tests-integration-testing-teuthology-workflow/#triggering-tests
393+ .. _Integration Test Introduction Page : ../tests-integration-testing-teuthology-intro/#how-integration-tests-are-defined
302394.. _tests-sentry-developers-guide : ../tests-sentry-developers-guide/
395+ .. _smithi : https://wiki.sepia.ceph.com/doku.php?id=hardware:smithi
396+ .. _teuthology installation guide : https://docs.ceph.com/projects/teuthology/en/latest/INSTALL.html#installation-and-setup
397+ .. _Filter Tests by their Description : ../tests-integration-testing-teuthology-intro/#filtering-tests-by-their-description
398+ .. _developer playground machine : https://wiki.sepia.ceph.com/doku.php?id=devplayground
0 commit comments