Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Integration testing harness #2359

Merged
merged 32 commits into from
Jun 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
0623a72
move config parsing back into main
dead10ck Apr 24, 2022
adb6cd5
Simplify handle_terminal_events signature
archseer Oct 26, 2021
308cab3
Integration testing harness
archseer Oct 26, 2021
502d329
improve test harness
dead10ck Jan 18, 2022
0f3c10a
Fix initial selection of Document in new view
dead10ck Mar 17, 2022
84bbe6b
refactor helpers, use new test helpers
dead10ck Apr 17, 2022
267605d
reorganize tests into groups
dead10ck Apr 17, 2022
36e5809
add test for ensuring the initial cursor on a newly opened file
dead10ck Apr 18, 2022
ee705dc
use main application event loop
dead10ck Apr 19, 2022
07fc80a
tests for serialized writes
dead10ck May 1, 2022
4012096
tests for buffer-close
dead10ck May 1, 2022
2386c81
use idle timer instead of fixed timeout
dead10ck Apr 24, 2022
2fbf833
add integration feature to github tests
dead10ck Apr 25, 2022
1533f48
use Results in integration tests for more error context
dead10ck Apr 26, 2022
ed950fc
Add more context; Editor::open doesn't need to own path
dead10ck Apr 26, 2022
652cdda
use test terminal backend for integration tests
dead10ck Apr 27, 2022
cb0440b
use env var for integration test log level
dead10ck Apr 27, 2022
4e34ee7
don't read from stdin for integration tests
dead10ck Apr 27, 2022
28e94fb
need the full languages config for integration tests
dead10ck Apr 27, 2022
ef8fe5a
use system's appropriate line ending
dead10ck Apr 29, 2022
acf9317
use a read only file to ensure write failure
dead10ck Apr 30, 2022
8d8d389
rename top level module to satisfy cargo fmt
dead10ck Apr 30, 2022
374724f
ignore failing write path tests until fixes are merged
dead10ck May 1, 2022
526c9be
consolidate idle timer logic, make conditional
dead10ck May 17, 2022
7c0bca1
rename test helpers
dead10ck May 22, 2022
fac36bc
add test for write-quit happy path
dead10ck May 23, 2022
41bf1d5
fix(command): write-quit: do not quit if write fails
dead10ck Mar 31, 2022
086b63a
add integration-test cargo alias
dead10ck Jun 2, 2022
65bf683
update docs for integration tests
dead10ck Jun 4, 2022
665286c
factor new Application with file arg to function
dead10ck Jun 11, 2022
5f7c247
replace phrase in tests
dead10ck Jun 14, 2022
458b89e
Merge branch 'master' into test-harness
archseer Jun 21, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .cargo/config
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
[alias]
xtask = "run --package xtask --"
integration-test = "test --features integration --workspace --test integration"
11 changes: 8 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ jobs:
test:
name: Test Suite
runs-on: ${{ matrix.os }}
env:
RUST_BACKTRACE: 1
HELIX_LOG_LEVEL: info
steps:
- name: Checkout sources
uses: actions/checkout@v3
Expand All @@ -50,9 +53,6 @@ jobs:

- uses: Swatinem/rust-cache@v1

- name: Copy minimal languages config
run: cp .github/workflows/languages.toml ./languages.toml
Comment on lines -53 to -54
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need the full languages config for integration tests

Do we? I'd list any languages we test with but avoid fetching uncommon grammars that won't ever be used in tests, that way we're not waiting for 50+ grammars to build.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, we can do that. It just means that a contributor will have to remember to add a language if they want to add tests for it. And it will be a bit confusing because their tests will pass locally for them, but fail on GitHub, and for not obvious reasons. It was failing for me on the C indentation test, but the failure was the wrong number of spaces. It took a while to figure out it was because of the grammar missing.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good point, maybe we should include languages.toml in the test directory, then conditionally compile using that languages.toml over the one in the root dir if running tests?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I just tried implementing this, but I just realized, the feature flag would help if we were only running one test command, but if we separate regular unit tests from integration tests into separate phases, then I'm not sure how to detect if we're running unit tests without the integration feature flag.


- name: Cache test tree-sitter grammar
uses: actions/cache@v3
with:
Expand All @@ -66,6 +66,11 @@ jobs:
command: test
args: --workspace

- name: Run cargo integration-test
uses: actions-rs/cargo@v1
with:
command: integration-test

strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
Expand Down
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
target
.direnv
helix-term/rustfmt.toml
helix-syntax/languages/
result
runtime/grammars
Loading