Skip to content

Commit

Permalink
Starts testing feature sets continuously
Browse files Browse the repository at this point in the history
Continuous feature testing ensures long-term health of the few feature
combinations that are important to us.

In this change:

- Added Github Actions to test renaming+icu_version_in_env, which is
  useful for Fuchsia and ICU uprevs there.  Not running full coverage at
  the moment due to combinatorial explosion.  I propose that from here
  onwards we test new ICU versions only, i.e. 67 and later.

- Made the compatibility matrix in README.md a bit more compact, to the
  extent possible.

- Added instructions on how to build `rust_icu` with a specific feature
  set.

Issue: #90
  • Loading branch information
filmil committed May 13, 2020
1 parent cc3e7e6 commit dc13850
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 20 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: rust_icu
name: rust_icu default feature set
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
test-default-features:
runs-on: ubuntu-latest
strategy:
matrix:
Expand All @@ -15,3 +15,16 @@ jobs:
- uses: actions/checkout@v2
- name: Test ICU version ${{ matrix.icu_version }}
run: "make DOCKER_TEST_ENV=rust_icu_testenv-${{ matrix.icu_version}} docker-test"
test-nondefault-features:
runs-on: ubuntu-latest
strategy:
matrix:
# This test matrix should be backfilled with more version/feature combos.
# I think any other combinations will fail today. We should fix those
# combinations, then expand this matrix.
icu_version: [65, 67]
feature_set: ["renaming icu_version_in_env"]
steps:
- uses: actions/checkout@v2
- name: Test ICU version ${{ matrix.icu_version }}
run: make DOCKER_TEST_ENV=rust_icu_testenv-${{ matrix.icu_version }} RUST_ICU_MAJOR_VERSION_NUMBER=${{ matrix.icu_version }} DOCKER_TEST_CARGO_TEST_ARGS="--no-default-features --features ${{ matrix.feature_set }}" docker-test
66 changes: 48 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,26 +92,28 @@ The limitations we know of today are as follows:
# Compatibility

The table below shows the support matrix that has been verified so far. Any
versions not mentioned explicitly have not been tested. Feel free to test a
version and send a pull request to add to this matrix once you confirm the
functionality. Each row is for a particular ICU library version. The column
headers of columns 2 and onwards are features set combos. The coverage
reflects the feature set and version points that we needed up to this point.
The version semver in each cell denotes the version point that was tested.

| ICU version | `default` | `renaming` | `renaming`, `icu_version_in_env` |
| ----------- | ----------| ---------- | --------------------------------- |
| 63.x | 0.1.3+ | - | - |
| 64.2 | 0.1.3+ | - | - |
| 65.1 | 0.1.3+ | 0.1.3+ | 0.1.3+ |
| 66.0.1 | 0.1.3+ | - | - |
| 67.1 | 0.1.4 | - | - |
versions not mentioned explicitly have not been tested. No guarantees are made
for those versions.

## Feature sets

* 1: default
* 2: "renaming"
* 3: "icu_version_in_env"

## Compatibility matrix

Each cell in the table shows which feature set combination has been tested for
this particular ICU library and `rust_icu` version combination.

| `rust_icu` version | ICU 63.x | ICU 64.2 | ICU 65.1 | ICU 66.0.1 | ICU 67.1 |
| ------------------ | -------- | -------- | --------- | ---------- | -------- |
| 0.1 ||||||
| 0.1.3 | 1 | 1 | 1; 2; 2+3 | 1 | 1 |
| 0.1.4 | 1 | 1 | 1; 2; 2+3 | 1 | 1 |

> API versions that differ in the minor version number only should be
> compatible; but since it is time consuming to test all versions and
> relatively easy to keep only the last major edition of the library around, we
> keep only one minor version per library in the table, until need arises to do
> something else.
> compatible.
# Features

Expand Down Expand Up @@ -467,3 +469,31 @@ When adding more ICU wrappers, make sure to do the following:
* Check `build.rs` to add appropriate lines into `bindgen_source_modules`, then
`whitelist_types_regexes` and `whitelist_functions_regexes`.

## Testing with a specific feature set turned on

Here's an example of running a docker test on ICU 67, with features
`icu_version_in_env` and `renaming` turned on instead of the default. Note that
the parameters are mostly passed into the container that runs `docker-test` via
environment variables.

```bash
make DOCKER_TEST_ENV=rust_icu_testenv-67 \
RUST_ICU_MAJOR_VERSION_NUMBER=67 \
DOCKER_TEST_CARGO_TEST_ARGS='--no-default-features --features icu_version_in_env renaming' \
docker-test
```

Some clarification:

* The environment variable `RUST_ICU_MAJOR_VERSION_NUMBER` is used for the
feature `icu_version_in_env` to instruct `cargo` to use the file
`rust_icu_sys/bindgen/lib_67.rs` as a prebuilt bindgen source file instead of
trying to generate one on the fly.
* The environment variable `DOCKER_TEST_CARGO_TEST_ARGS` is used to pass the
command line arguments to the `cargo test` which is used in the docker container.
The environment is passed in verbatim to `cargo test` without quoting, so separate
words in the environment end up being separate args to `cargo test`.
* The environment variable `DOCKER_TEST_ENV` is the base name of the Docker container
used to run the test in. The container `rust_icu_testenv-67` is a container image
that contains preinstalled environment with a compiled version of ICU 67.

0 comments on commit dc13850

Please sign in to comment.