From 59ca5bdabc649b86dafcc8cc2dfed0873bd6f92a Mon Sep 17 00:00:00 2001 From: Myriad-Dreamin <35292584+Myriad-Dreamin@users.noreply.github.com> Date: Tue, 9 Apr 2024 12:37:01 +0800 Subject: [PATCH] chore: fix test scripts and update test documents (#178) * chore: fix test scripts and update test documents * docs: redirect developer who want to build and test to the contributing guide * dev: change wording --- CONTRIBUTING.md | 26 ++++++++++++++++++++++++++ crates/tinymist-query/README.md | 4 ++++ crates/tinymist-render/README.md | 4 ++++ crates/tinymist/README.md | 4 ++++ scripts/e2e.ps1 | 8 ++++++-- scripts/e2e.sh | 1 + 6 files changed, 45 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 929eae10..0dcf0290 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -25,3 +25,29 @@ cargo build ``` To run VS Code extension locally, open the repository in VS Code and press `F5` to start a debug session to extension. + +## Run analyzer tests + +This is required if you have changed any code in `crates/tinymist-query`. + +To run analyzer tests for tinymist: + +```bash +cargo insta test -p tinymist-query --accept +``` + +## Run e2e tests + +This is required if you have changed any code in `crates/tinymist` or `crates/tinymist-query`. + +To run e2e tests for tinymist on Unix systems: + +```bash +./scripts/e2e.sh +``` + +To run e2e tests for tinymist on Windows: + +```bash +./scripts/e2e.ps1 +``` diff --git a/crates/tinymist-query/README.md b/crates/tinymist-query/README.md index f3676a34..79fe7079 100644 --- a/crates/tinymist-query/README.md +++ b/crates/tinymist-query/README.md @@ -5,3 +5,7 @@ This crate provides a set of APIs to query the information about the source code. Currently it provides: + language queries defined by the [Language Server Protocol](https://microsoft.github.io/language-server-protocol/). + +## Contributing + +See [CONTRIBUTING.md](https://github.com/Myriad-Dreamin/tinymist/blob/main/CONTRIBUTING.md). diff --git a/crates/tinymist-render/README.md b/crates/tinymist-render/README.md index 1cce5213..ce544125 100644 --- a/crates/tinymist-render/README.md +++ b/crates/tinymist-render/README.md @@ -5,3 +5,7 @@ This crate provides rendering features for tinymist server. Currently it provides: + rendering in telescope mode for hover. + +## Contributing + +See [CONTRIBUTING.md](https://github.com/Myriad-Dreamin/tinymist/blob/main/CONTRIBUTING.md). diff --git a/crates/tinymist/README.md b/crates/tinymist/README.md index e8081055..0ac0779b 100644 --- a/crates/tinymist/README.md +++ b/crates/tinymist/README.md @@ -43,3 +43,7 @@ dhat: The data has been saved to dhat-heap.json, and is viewable with dhat/dh_vi ``` Once you have the `dhat-heap.json`, you can visualize the memory usage with [the DHAT viewer](https://nnethercote.github.io/dh_view/dh_view.html). + +## Contributing + +See [CONTRIBUTING.md](https://github.com/Myriad-Dreamin/tinymist/blob/main/CONTRIBUTING.md). diff --git a/scripts/e2e.ps1 b/scripts/e2e.ps1 index 620b1446..b6b81e78 100644 --- a/scripts/e2e.ps1 +++ b/scripts/e2e.ps1 @@ -1,4 +1,8 @@ - +$InstallPath = ".\editors\vscode\out" +if (-Not (Test-Path $InstallPath)) { + New-Item -ItemType Directory $InstallPath +} + cargo build --release --bin tinymist -Copy-Item -Path ".\target\release\tinymist.exe" -Destination ".\editors\vscode\out\tinymist.exe" -Force +Copy-Item -Path ".\target\release\tinymist.exe" -Destination "$InstallPath\tinymist.exe" -Force cargo insta test -p tests --accept diff --git a/scripts/e2e.sh b/scripts/e2e.sh index 1f0d8ee6..3cdf4e3a 100755 --- a/scripts/e2e.sh +++ b/scripts/e2e.sh @@ -1,3 +1,4 @@ +mkdir -p editors/vscode/out/ cargo build --release --bin tinymist cp target/release/tinymist editors/vscode/out/tinymist cargo insta test -p tests --accept