Using the @test command to trigger tests#475
Using the @test command to trigger tests#475tcNickolas merged 4 commits intomicrosoft:masterfrom vivanwin:master
Conversation
|
It is my understanding that #468 is going to remove most, if not all, instructions on updating IQ# to a specific version in the notebooks, so a part of this change might become obsolete. @rmshaffer, could you share your plan for #468? |
I believe @vivanwin's approach here is better than the one I had started in #468. There is still a possibility that version mismatches could cause problems, since there is a version of the Katas package specified in the |
rmshaffer
left a comment
There was a problem hiding this comment.
Looks good to me! (Pending CI issues, of course -- I can help investigate those if needed.) Will leave for @tcNickolas to approve.
| "> The package versions in the output of the cell above should always match the latest version which is `Microsoft.Quantum.Katas::0.12.20082513`. If you are running the Notebooks locally and the versions do not match, please install the IQ# version that matches the version of the `Microsoft.Quantum.Katas` package.\n", | ||
| "> <details>\n", | ||
| "> <summary><u>How to install the right IQ# version</u></summary>\n", | ||
| "> For example, if the version of `Microsoft.Quantum.Katas` package above is 0.1.2.3, the installation steps are as follows:\n", |
There was a problem hiding this comment.
Do you want to remove the "0.1.2.3" from here as well?
There was a problem hiding this comment.
I have updated this to include the actual version.
| "> The package versions in the output of the cell above should always match. If you are running the Notebooks locally and the versions do not match, please install the IQ# version that matches the version of the `Microsoft.Quantum.Katas` package.\n", | ||
| "> The package versions in the output of the cell above should always match the latest version which is `Microsoft.Quantum.Katas::0.12.20082513`. If you are running the Notebooks locally and the versions do not match, please install the IQ# version that matches the version of the `Microsoft.Quantum.Katas` package.\n", | ||
| "> <details>\n", | ||
| "> <summary><u>How to install the right IQ# version</u></summary>\n", |
There was a problem hiding this comment.
This is unrelated to your change, but I just noticed that these instructions are not correct for users who have installed IQ# using Anaconda. For those users, the command would be just one line:
conda update -c quantum-engineering qsharp==0.12.20082513
@tcNickolas do you think it is worth updating all of the notebooks to include this instruction as well, since conda is now the recommended installation path for IQ#? I would be happy to do that in a future PR.
There was a problem hiding this comment.
I think it could not hurt to add this.
There was a problem hiding this comment.
I really liked the part of your PR in which the installation instructions were removed from the notebooks altogether together with the %package and %workspace reload cells. Ideally there should be one place for installation instructions, and that's the main project README; I don't really like the idea of covering all possible scenarios of installation in each notebook.
There was a problem hiding this comment.
@tcNickolas yes, I like that part of my PR too. 😊
If you think it's appropriate, then, I like the idea of moving the installation instructions to the main README. I do believe the likelihood that users run into problems here is reduced with recent changes to versioning and package loading.
One idea: Put the installation instructions only in the main README, and then in each notebook, have a small blurb of text that says something like: "Getting errors? See the README."
|
@vivanwin I believe I've identified the root cause of the CI failures here. It appears to be a bug in IQ# -- the kernel is reporting itself as ready to execute cells too early, before the packages have finished loading. (It's a timing issue, and unfortunately the CI tries to execute the first cell immediately after the kernel reports itself as ready.) There's a simple fix, but unfortunately it's in IQ# code and wouldn't be available until the next release. Since it's a timing issue, I am hoping this can be worked around for now by keeping the |
|
If this is indeed the case, it's unfortunate, I was looking forward to getting rid of those cells :-( Here is what I would do in this case:
What do you think? |
Would the same issue affect the |
That's a great point, @cgranade! I hadn't thought of that. That code path is separate and should not be affected by this issue. @vivanwin, to try this out:
That should ensure that the listed packages have all been loaded before executing the first cell. In my testing this causes the kernel startup to take a bit longer (as would be expected, since it's loading additional packages), and so in order for CI to pass reliably you may also want to increase the startup timeout by adding something like: |
|
@rmshaffer Is this change necessary for adopting |
No, it's not. It's only necessary for removing the Yes, agreed, we should do this change separately (and I will investigate that as part of my PR #468). @vivanwin, please disregard my previous suggestion, I'll try that out myself! 😊 |
tcNickolas
left a comment
There was a problem hiding this comment.
Looks good - I tried it locally, and I love how this gives fewer levels of nesting for the tests in VS Test Explorer. Also, it's neat that we can use different simulators for different tests (for example, in task 1.2 we don't really need CounterSimulator, QuantumSimulator would be enough) and they don't look non-uniform.
Thank you! I'll merge this, and I think we can do a similar switch for the rest of the katas.
This is a first commit to change the current way of testing, to a newer method which will use the Q# @test functionality.
There is also an update to the update script. This will make sure that the text which explains how to install IQsharp uses the latest version in the example.