YongseopKim / ONE-vscode

Visual Studio Code Extension of ONE compiler toolchain
Apache License 2.0
0 stars 0 forks source link

unittest #8

Closed YongseopKim closed 2 years ago

YongseopKim commented 2 years ago

cmd가 실제로 필요한 테스트와, 아닌 테스트로 나뉘어야 함

YongseopKim commented 2 years ago
--grep 'integrated'
--grep 'mockup'
YongseopKim commented 2 years ago

mocha: https://mochajs.org chai: https://www.chaijs.com

YongseopKim commented 2 years ago

one-import-bcq has one-import-onnx

YongseopKim commented 2 years ago

ui와 관련된 test는 제외 positive tests만 BuilderCfgFile: 대다수가 private

YongseopKim commented 2 years ago

test bdd로 두번 임포트하는 경우

YongseopKim commented 2 years ago

리드미 작성

YongseopKim commented 2 years ago

nvm

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
source ~/.zshrc

nvm install 16.14.0
nvm use 16.14.0

npm 8.3.1

YongseopKim commented 2 years ago

Extension Development Host

# - Launches VS Code Extension Host
code \
--extensionDevelopmentPath=<EXTENSION-ROOT-PATH> \ # - Loads the extension at <EXTENSION-ROOT-PATH>
--extensionTestsPath=<TEST-RUNNER-SCRIPT-PATH> # - Executes the test runner script at <TEST-RUNNER-SCRIPT-PATH>

The test script (runTest.ts)

The test runner script (index.ts)

Because of VS Code's limitation, if you are using VS Code stable release and try to run the integration test on CLI, it will throw an error:

Running extension tests from the command line is currently only supported if no other instance of Code is running.

In general if you run extension tests from CLI, the version the tests run with cannot be running already. As a workaround, you can run the tests in VS Code Stable and use VS Code Insiders for development. As long as you are not running the tests from CLI in VS Code Insiders but in VS Code Stable, this setup will work fine.