xref: /trunk/test/aoo-test/README.md (revision 2c760c133df3253aa7075d23c106a30339fca6f2)
105e6a109SJim Jagielski<!--
205e6a109SJim Jagielski Licensed to the Apache Software Foundation (ASF) under one
305e6a109SJim Jagielski or more contributor license agreements.  See the NOTICE file
405e6a109SJim Jagielski distributed with this work for additional information
505e6a109SJim Jagielski regarding copyright ownership.  The ASF licenses this file
605e6a109SJim Jagielski to you under the Apache License, Version 2.0 (the
705e6a109SJim Jagielski "License"); you may not use this file except in compliance
805e6a109SJim Jagielski with the License.  You may obtain a copy of the License at
905e6a109SJim Jagielski
1005e6a109SJim Jagielski   http://www.apache.org/licenses/LICENSE-2.0
1105e6a109SJim Jagielski
1205e6a109SJim Jagielski Unless required by applicable law or agreed to in writing,
1305e6a109SJim Jagielski software distributed under the License is distributed on an
1405e6a109SJim Jagielski "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
1505e6a109SJim Jagielski KIND, either express or implied.  See the License for the
1605e6a109SJim Jagielski specific language governing permissions and limitations
1705e6a109SJim Jagielski under the License.
1805e6a109SJim Jagielski-->
1905e6a109SJim Jagielski
202cb6d6f1SJim Jagielski# AOO test suite
212cb6d6f1SJim Jagielski
222cb6d6f1SJim JagielskiA pytest suite for an installed Apache OpenOffice 5 or later. It starts the office you point it at, drives it over UNO, and checks what comes out: ODF conformance in each save mode, import of ODF 1.2 and 1.3 files, document conversion, and a smoke test of the main components.
232cb6d6f1SJim Jagielski
242cb6d6f1SJim JagielskiThe only required input is where the office is installed. The suite runs the same way on any platform and works with an install, so no source tree or build is needed.
252cb6d6f1SJim Jagielski
262cb6d6f1SJim Jagielski## What it checks
272cb6d6f1SJim Jagielski
282cb6d6f1SJim Jagielski| Directory | Needs an office | What |
292cb6d6f1SJim Jagielski|---|---|---|
302cb6d6f1SJim Jagielski| `tests/selftest` | no | The checkers (schema validation, package rules, document types, xml ids, formula syntax, decryption) against documents built to fail. |
312cb6d6f1SJim Jagielski| `tests/harness` | no | Install discovery, the worker protocol and process handling, against fake installs and a fake worker. |
322cb6d6f1SJim Jagielski| `tests/smoke` | yes | Start, connect, new/save/reload per application and save mode, conversion, and the old smoke test document (Writer, Calc, Impress, Draw, HTML, chart, Math, Bibliography, extensions). |
33*2c760c13SJim Jagielski| `tests/odf` | yes | Documents saved in each ODF save mode and checked against the ODF 1.2, 1.3 and 1.4 schemas and the package rules, with a second validator (odfvalidator) as a cross-check; documents the suite builds, saved and read back; saving twice for stable output; the error kinds of the extended modes compared with a stored baseline; password-protected documents decrypted by an independent implementation; about 300 OpenFormula cases evaluated in Calc; and, with a corpus, ODF 1.2 and 1.3 twins compared after import. Everything but the formula cases is marked `slow`. |
342cb6d6f1SJim Jagielski
352cb6d6f1SJim Jagielski## What it does not include
362cb6d6f1SJim Jagielski
372cb6d6f1SJim JagielskiNothing third party and no binary documents are stored here.
382cb6d6f1SJim Jagielski
392cb6d6f1SJim Jagielski- Test documents come from the office under test: the templates and documents it ships, and documents it creates when the tests run. See [USAGE.md](USAGE.md#source-documents).
4085d6e4e5SJim Jagielski- Some documents the suite can build are left out of the default run because converting them kills or stalls the office: Calc documents with tracked changes and all Base documents. They are listed with the reason in `data/built-excluded.tsv` and run with `python3 -m pytest -m crash`.
412cb6d6f1SJim Jagielski- The OASIS schemas, jing and odfvalidator are downloaded once into a cache and checked against pinned sha256 values. Without them the tests that need them skip, with a reason.
422cb6d6f1SJim Jagielski
432cb6d6f1SJim Jagielski## Requirements
442cb6d6f1SJim Jagielski
452cb6d6f1SJim Jagielski- Python 3.10 or later and pytest 8 or later. Nothing else is needed to run the tests.
462cb6d6f1SJim Jagielski- An installed AOO 5 or later.
472cb6d6f1SJim Jagielski- A Python that can import `uno` from that install. The suite finds one itself, preferring the install's own `program/python`; see [USAGE.md](USAGE.md#pyuno).
482cb6d6f1SJim Jagielski- Java, for the schema checks. Without it those items skip.
492cb6d6f1SJim Jagielski
502cb6d6f1SJim Jagielski## Quick start
512cb6d6f1SJim Jagielski
522cb6d6f1SJim JagielskiFrom this directory:
532cb6d6f1SJim Jagielski
542cb6d6f1SJim Jagielski    python3 -m pytest -m selftest                    # no office needed
552cb6d6f1SJim Jagielski    PYTHONPATH=src python3 -m aootest.fetch          # once: schemas and jing, about 20 MB
562cb6d6f1SJim Jagielski    AOO_OFFICE=/path/to/install python3 -m pytest -m "not slow"
572cb6d6f1SJim Jagielski    AOO_OFFICE=/path/to/install python3 -m pytest    # everything, several minutes
582cb6d6f1SJim Jagielski
592cb6d6f1SJim Jagielski`AOO_OFFICE` can be an `.app` bundle, the install root, its `program` directory, or the `soffice` launcher.
602cb6d6f1SJim Jagielski
612cb6d6f1SJim Jagielski## Where it has been run
622cb6d6f1SJim Jagielski
632cb6d6f1SJim JagielskimacOS arm64 (an installed 5.1.0 and a trunk build) and Ubuntu 24.04 aarch64 (a trunk build). The Windows and FreeBSD code paths are covered by tests against fake installs only; nobody has run the suite on those systems yet.
642cb6d6f1SJim Jagielski
652cb6d6f1SJim JagielskiSee [USAGE.md](USAGE.md) for options, expectation files and how to read results.
66