Skip to content

Commit d281d82

Browse files
authored
add kittest tests (#50)
* add kittest snapshot tests * fix editor demo - check for valid object key when pressing enter * add editor demo kittest tests * add ci caching * reorder ci steps separate test job * replace query/unwrap with get * rename test file * treat warnings as errors in CI add docs check step * add accessibility widget info under test predicate for collapsing headers, with json pointer as label * add tests * convert two snapshot tests * convert snapshot test * refactor snapshot tests * update comment * fix running snapshot tests with simd_json * add editor test and asserts
1 parent ff85a81 commit d281d82

30 files changed

Lines changed: 1036 additions & 624 deletions

.github/workflows/ci.yml

Lines changed: 23 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,47 @@ on:
66
- main
77
pull_request:
88

9+
env:
10+
RUSTFLAGS: -D warnings
11+
RUSTDOCFLAGS: -D warnings
12+
913
jobs:
1014
build:
1115
runs-on: ubuntu-latest
1216
steps:
1317
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
1418
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 # v1.13.0
19+
- uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2.8.0
20+
- name: Format
21+
run: cargo fmt --all -- --check
22+
- name: Docs
23+
run: cargo doc --lib --no-deps --all-features
24+
- name: Clippy
25+
run: cargo clippy
1526
- name: Build
1627
run: cargo build --locked --workspace
28+
29+
test:
30+
needs: build
31+
runs-on: macos-15 # For snapshot testing.
32+
steps:
33+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
34+
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 # v1.13.0
35+
- uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2.8.0
1736
- name: Test
1837
run: cargo test --locked
19-
- name: Test json_tree_test for simd_json feature
20-
run: cargo test --locked --features=simd_json --no-default-features --test json_tree_test
21-
- name: Clippy
22-
run: cargo clippy
23-
- name: Format
24-
run: cargo fmt --all -- --check
38+
- name: Test for simd_json feature
39+
run: cargo test --locked --package egui_json_tree --test image_snapshot_tests --features simd_json --no-default-features
2540

2641
web-demo:
27-
needs: build
42+
needs: test
2843
permissions:
2944
contents: write
3045
runs-on: ubuntu-latest
3146
steps:
3247
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
3348
- uses: actions-rust-lang/setup-rust-toolchain@fb51252c7ba57d633bc668f941da052e410add48 # v1.13.0
49+
- uses: Swatinem/rust-cache@98c8021b550208e191a6a3145459bfc9fb29c4c0 # v2.8.0
3450
- uses: jetli/trunk-action@1346cc09eace4beb84e403e199a471346d4684c9 # v0.5.1
3551
with:
3652
version: "v0.21.14"

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
.vscode
33
dist
44
.DS_Store
5+
**/tests/snapshots/**/*.diff.png
6+
**/tests/snapshots/**/*.new.png

0 commit comments

Comments
 (0)