Repository navigation
Move all samples testing to Rust unit tests - #1739
Conversation
This expands the unit tests in the samples_test folder to include testing of all samples, including compilation of resource estimation samples, compilation of dynamically discovered qsharp.json projects, and compile and run of language samples. With these additions, the build script no longer needs to compile the qsc cmdline tool and can skip the cmdline based compilation of samples, so the build.py file is updated here to remove those.
Benchmark for 6b5d87dClick to view benchmark
|
Alex Hansen (sezna)
left a comment
There was a problem hiding this comment.
I really appreciate the scripting being done in build.rs versus some other environment, for the simplicity of cargo test Just Working ™️
|
Stefan J. Wernli (@swernli) How do I debug a failing test? |
You can debug each module, which will launch the debugger for the tests covered by that module (each test in it's own thread): You can also ctl/cmd + click on the file name in the include macro to jump to the build-time generated file and set breakpoints inside of individual test cases. |
Benchmark for 2720f0bClick to view benchmark
|
Benchmark for 32a4fbaClick to view benchmark
|
|
I changed the file generation strategy to split the difference between these being pure build artifacts and being checked in source files. Now the test files are generated to the src folder so they can used and debugged like normal tests, but they are added to the gitignore so that aren't part of the source-controlled content. |
Benchmark for 3f53b24Click to view benchmark
|
Benchmark for b08b9a9Click to view benchmark
|
Benchmark for 17af7d2Click to view benchmark
|
Benchmark for 5c7be98Click to view benchmark
|

This expands the unit tests in the samples_test folder to include testing of all samples, including compilation of resource estimation samples, compilation of dynamically discovered qsharp.json projects, and compile and run of language samples. With these additions, the build script no longer needs to compile the qsc cmdline tool and can skip the cmdline based compilation of samples, so the build.py file is updated here to remove those.