Automattic / Automattic/harper

test_pos_tagger fails on big endian hosts

Open
#1,823 5 comments 0 reactions 0 assignees View on GitHub
bug testing
Dominant language
Rust
Stars
15.4k
Forks
627
Avg merge
1d 15h
Merged PRs (30d)
102

Description

**Describe the bug**

On big-endian hosts (e.g.: s390x), the test `test_pos_tagger` fails

**To Reproduce**

1. `cargo test`

**Expected behavior**

Test should pass

**Actual behaviour**

```
test test_pos_tagger ... FAILED
failures:
---- test_pos_tagger stdout ----
Processing /builds/WhyNotHugo/aports/testing/harper/src/harper-0.59.0/harper-core/tests/text/Swear.md
Processing /builds/WhyNotHugo/aports/testing/harper/src/harper-0.59.0/harper-core/tests/text/Difficult sentences.md
Processing /builds/WhyNotHugo/aports/testing/harper/src/harper-0.59.0/harper-core/tests/text/Part-of-speech tagging.md
Processing /builds/WhyNotHugo/aports/testing/harper/src/harper-0.59.0/harper-core/tests/text/this and that.md
Processing /builds/WhyNotHugo/aports/testing/harper/src/harper-0.59.0/harper-core/tests/text/Alice's Adventures in Wonderland.md
Processing /builds/WhyNotHugo/aports/testing/harper/src/harper-0.59.0/harper-core/tests/text/The Great Gatsby.md
Processing /builds/WhyNotHugo/aports/testing/harper/src/harper-0.59.0/harper-core/tests/text/Spell.md
Processing /builds/WhyNotHugo/aports/testing/harper/src/harper-0.59.0/harper-core/tests/text/Spell.US.md
Error processing /builds/WhyNotHugo/aports/testing/harper/src/harper-0.59.0/harper-core/tests/text/Swear.md: Snapshot mismatches!
Processing /builds/WhyNotHugo/aports/testing/harper/src/harper-0.59.0/harper-core/tests/text/Computer science.md
Error processing /builds/WhyNotHugo/aports/testing/harper/src/harper-0.59.0/harper-core/tests/text/Spell.md: Snapshot mismatches!
Processing /builds/WhyNotHugo/aports/testing/harper/src/harper-0.59.0/harper-core/tests/text/The Constitution of the United States.md
Error processing /builds/WhyNotHugo/aports/testing/harper/src/harper-0.59.0/harper-core/tests/text/Spell.US.md: Snapshot mismatches!
Error processing /builds/WhyNotHugo/aports/testing/harper/src/harper-0.59.0/harper-core/tests/text/this and that.md: Snapshot mismatches!
Error processing /builds/WhyNotHugo/aports/testing/harper/src/harper-0.59.0/harper-core/tests/text/Part-of-speech tagging.md: Snapshot mismatches!
Error processing /builds/WhyNotHugo/aports/testing/harper/src/harper-0.59.0/harper-core/tests/text/Difficult sentences.md: Snapshot mismatches!
Error processing /builds/WhyNotHugo/aports/testing/harper/src/harper-0.59.0/harper-core/tests/text/Computer science.md: Snapshot mismatches!
Error processing /builds/WhyNotHugo/aports/testing/harper/src/harper-0.59.0/harper-core/tests/text/The Constitution of the United States.md: Snapshot mismatches!
Error processing /builds/WhyNotHugo/aports/testing/harper/src/harper-0.59.0/harper-core/tests/text/Alice's Adventures in Wonderland.md: Snapshot mismatches!
Error processing /builds/WhyNotHugo/aports/testing/harper/src/harper-0.59.0/harper-core/tests/text/The Great Gatsby.md: Snapshot mismatches!
thread 'test_pos_tagger' panicked at harper-core/tests/snapshot.rs:109:9:
10 errors occurred while processing files
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
failures:
test_pos_tagger
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 0 filtered out; finished in 16.83s
error: test failed, to rerun pass `-p harper-core --test pos_tags`
```

**Platform**

Running tests while packaging.

Contributor guide

Open the contributing guide

Research direction

Start by running `cargo test -p harper-core --test pos_tags` and inspect `harper-core/tests/snapshot.rs` around line 109, where `test_pos_tagger` reports snapshot mismatches. Compare the failing snapshots on a big-endian host with the expected results; done means `test_pos_tagger` passes on big-endian hosts while retaining the existing behavior elsewhere.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.