tawasuyu

tawasuyu/taffy

A high performance rust-powered UI layout library

Rust 501HTML 254C 19JavaScript 81412 Definitions

⎇ 9ca8c202aa6ca82714b16bcebd7ac2d527e338ec CONTRIBUTING.md Markdown · 36 lines · 2.2 KB History raw

Restore and fix gentest (#145) 39cd0fcbb · François ·

1# Contributing
2
3This is a cross-team project, aiming to build solid foundations for Rust UI libraries of all sorts.
4New contributions are extremely welcome!
5
6The basic process is simple:
7
81. Pick an [issue](https://github.com/DioxusLabs/taffy/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22), or [file a new one](https://github.com/DioxusLabs/taffy/issues/new).
92. Comment in the issue that you plan to tackle it, and the team will assign the task to you.
103. Submit a PR.
114. Respond to feedback from reviewers and make sure CI passes.
12
13The PR review process is completely open:  help us by commenting on, testing and approving PRs.
14
15If you'd like to help on a consistent basis or are interested in project management, create a Discussions post, and we'll be happy to hand out triage rights.
16
17## Testing
18
19Flexbox layouts are tested by validating that layouts written in this crate perform the same as in Chrome.
20This is done by rendering an equivalent layout in HTML and then generating a Rust test case which asserts that the resulting layout is the same when run through our layout engine.
21
22You can run these tests without setting up a webdriver environment but if you are looking to add any test case you will need to install [chromedriver](http://chromedriver.chromium.org) and [Chrome](https://www.google.com/chrome/).
23If you are developing on macOS this is easy to do through brew.
24
25```bash
26brew install chromedriver
27```
28
29Once you have chromedriver installed and available in `PATH` you can re-generate all tests by running `cargo run --package gentest`. You should not manually update the tests in `tests/generated`. Instead, fix the script in `scripts/gentest/` and re-generate them. This can happen after a refactor. It can be helpful to commit the updated tests in a dedicated commit so that they can be easier to ignore during review.
30
31To add a new test case add another HTML file to `/test_fixtures` following the current tests as a template for new tests.
32
33## Benchmarking
34
35Benchmarks build on the same infrastructure as testing, and actually benchmarks are automatically generated from test fixtures just like tests.
36Run `cargo bench` to run benchmarks locally.

CONTRIBUTING.md

Contributing

This is a cross-team project, aiming to build solid foundations for Rust UI libraries of all sorts. New contributions are extremely welcome!

The basic process is simple:

  1. Pick an issue, or file a new one.
  2. Comment in the issue that you plan to tackle it, and the team will assign the task to you.
  3. Submit a PR.
  4. Respond to feedback from reviewers and make sure CI passes.

The PR review process is completely open: help us by commenting on, testing and approving PRs.

If you'd like to help on a consistent basis or are interested in project management, create a Discussions post, and we'll be happy to hand out triage rights.

Testing

Flexbox layouts are tested by validating that layouts written in this crate perform the same as in Chrome. This is done by rendering an equivalent layout in HTML and then generating a Rust test case which asserts that the resulting layout is the same when run through our layout engine.

You can run these tests without setting up a webdriver environment but if you are looking to add any test case you will need to install chromedriver and Chrome. If you are developing on macOS this is easy to do through brew.

brew install chromedriver

Once you have chromedriver installed and available in PATH you can re-generate all tests by running cargo run --package gentest. You should not manually update the tests in tests/generated. Instead, fix the script in scripts/gentest/ and re-generate them. This can happen after a refactor. It can be helpful to commit the updated tests in a dedicated commit so that they can be easier to ignore during review.

To add a new test case add another HTML file to /test_fixtures following the current tests as a template for new tests.

Benchmarking

Benchmarks build on the same infrastructure as testing, and actually benchmarks are automatically generated from test fixtures just like tests. Run cargo bench to run benchmarks locally.