-
Notifications
You must be signed in to change notification settings - Fork 101
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
Alphapeptdeep Integration #3123
base: master
Are you sure you want to change the base?
Changes from 1 commit
a5f1e47
c4e7c59
dc612f9
d77d35e
9d6cab0
888627c
d06c394
3b12574
1e5eb21
f2d97e9
7812cb5
5c487ab
eade5f9
e0a85e1
15930d7
dab7240
494b457
622c47a
668f811
2043f45
88f3295
1aec5af
9a5b1d4
36c7475
6a90908
9c6215f
c0ffffe
562abf6
67ddfb2
7b3c790
e793804
c125325
b8ea2a7
d2fd31f
bd5ab7d
402aec4
07863b8
9a7f641
89e9cc8
00e0d4b
dbd9f42
7e5a065
4049ae2
b16dadc
039fd70
53dd101
23f3ff1
2682501
72176c6
e04ce1a
eeb6b82
d3764ec
6b438ea
845978d
cb312c6
d39f34f
c88d824
82760a1
a8e344b
4afe7cc
2d6388d
0688888
afca6cf
cb061bd
2e809c8
6178f74
ecf8116
8c104a8
58df59a
e562344
ae3f388
d3f46fc
5eee0bf
15ce719
aebc724
dddfd7b
ddea79b
e91b009
63c1519
5c7e1a3
9affaca
85201e1
ebe3448
41fab43
f847e65
b2c1517
d20d558
d05b4e0
5579a2b
d8de121
36f2650
905e2e8
41e12a7
7098c65
bb6e6be
e6a8f29
1fc1702
f858c8a
4333566
59cbeec
8ad214d
4af80b2
0f53ca9
2b62301
142b8a9
645528d
47d0d3b
52b7405
d42c1c5
fcaeeb0
b6fb2a5
257dd1b
6564801
8464baa
d098e06
6327653
a0a1393
268db8e
fc2219c
00f5ea2
c58d7aa
51c18e8
8ac1ad5
5d6f4be
ad00b9d
0312949
eec4ea0
b083747
7267a09
98da8b9
9935a83
f04d1af
892b23b
97ce458
acbbe26
b1bbb34
70442cc
b0c1761
1f4a042
433dc30
8ce8558
7dfc61c
266448a
8a8043a
4474db7
132cd15
0e4794d
a16806c
1dd4c4f
6749eb6
1b6b2cf
30fd835
1e14b95
e6f0f7b
bc91a5c
ea7936f
2d78935
354c901
c2cacd5
577c877
b50dbbf
02264a7
da298a0
6d5288c
d1bef56
4650224
80d39a5
1df275c
ac0c94c
1c10711
ec61351
a079a87
d8200dd
300e1b6
4212ebe
651b777
2d5eeb3
c3da42b
fc07478
6d928bf
3da2cf9
6821259
df735a8
7893764
a3a17c9
8c259da
bde691a
1ebc4c7
48e13c9
b68b4ec
43258bf
a11b547
0646be7
d6c2933
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,23 @@ | ||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
/* | ||
* Author and maintainer: David Shteynberg <david.shteynberg .at. proton.me>, | ||
* MacCoss Lab, Department of Genome Sciences, UW | ||
* | ||
* Copyright 2025 University of Washington - Seattle, WA | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
using Microsoft.VisualStudio.TestTools.UnitTesting; | ||
using pwiz.Skyline.Alerts; | ||
using pwiz.Skyline.Model.Tools; | ||
using pwiz.Skyline.SettingsUI; | ||
|
@@ -10,7 +29,7 @@ | |
namespace pwiz.SkylineTestUtil | ||
{ | ||
[TestClass] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Drop this - this isn't a test, it's code supporting tests |
||
public class PythonTestUtil : AbstractFunctionalTestEx | ||
public class PythonTestUtil | ||
{ | ||
private string _pythonVersion | ||
{ | ||
|
@@ -66,42 +85,42 @@ public void CancelPython(BuildLibraryDlg buildLibraryDlg) | |
{ | ||
// Test the control path where Python is not installed, and the user is prompted to deal with admin access | ||
PythonInstaller.SimulatedInstallationState = PythonInstaller.eSimulatedInstallationState.NAIVE; // Simulates not having the needed registry settings | ||
var installPythonDlg = ShowDialog<MultiButtonMsgDlg>(() => buildLibraryDlg.OkWizardPage()); // Expect the offer to install Python | ||
var installPythonDlg = AbstractFunctionalTest.ShowDialog<MultiButtonMsgDlg>(() => buildLibraryDlg.OkWizardPage()); // Expect the offer to install Python | ||
//PauseTest("install offer"); | ||
AssertEx.AreComparableStrings(ToolsUIResources.PythonInstaller_BuildPrecursorTable_Python_0_installation_is_required, installPythonDlg.Message); | ||
CancelDialog(installPythonDlg, installPythonDlg.CancelDialog); // Cancel it immediately | ||
AbstractFunctionalTest.CancelDialog(installPythonDlg, installPythonDlg.CancelDialog); // Cancel it immediately | ||
//PauseTest("back to wizard"); | ||
installPythonDlg = ShowDialog<MultiButtonMsgDlg>(() => buildLibraryDlg.OkWizardPage()); // Expect the offer to install Python | ||
installPythonDlg = AbstractFunctionalTest.ShowDialog<MultiButtonMsgDlg>(() => buildLibraryDlg.OkWizardPage()); // Expect the offer to install Python | ||
// PauseTest("install offer again"); | ||
AssertEx.AreComparableStrings(ToolsUIResources.PythonInstaller_BuildPrecursorTable_Python_0_installation_is_required, installPythonDlg.Message); | ||
var needAdminDlg = ShowDialog<MessageDlg>(installPythonDlg.OkDialog); // Expect to be told about needing admin access | ||
var needAdminDlg = AbstractFunctionalTest.ShowDialog<MessageDlg>(installPythonDlg.OkDialog); // Expect to be told about needing admin access | ||
// PauseTest("need admin msg"); | ||
AssertEx.AreComparableStrings(ToolsUIResources.PythonInstaller_Requesting_Administrator_elevation, needAdminDlg.Message); | ||
CancelDialog(needAdminDlg, needAdminDlg.CancelDialog); | ||
AbstractFunctionalTest.CancelDialog(needAdminDlg, needAdminDlg.CancelDialog); | ||
// PauseTest("back to wizard"); | ||
} | ||
public bool InstallPython(BuildLibraryDlg buildLibraryDlg) | ||
{ | ||
PythonInstaller.SimulatedInstallationState = PythonInstaller.eSimulatedInstallationState.NONE; // Normal tests systems will have registry set suitably | ||
|
||
bool havePythonPrerequisite = false; | ||
RunUI(() => { havePythonPrerequisite = buildLibraryDlg.PythonRequirementMet(); }); | ||
AbstractFunctionalTest.RunUI(() => { havePythonPrerequisite = buildLibraryDlg.PythonRequirementMet(); }); | ||
|
||
if (!havePythonPrerequisite) | ||
{ | ||
MessageDlg confirmDlg = null; | ||
MultiButtonMsgDlg nvidiaDlg = null; | ||
RunLongDlg<MultiButtonMsgDlg>(buildLibraryDlg.OkWizardPage, pythonDlg => | ||
AbstractFunctionalTest.RunLongDlg<MultiButtonMsgDlg>(buildLibraryDlg.OkWizardPage, pythonDlg => | ||
{ | ||
Assert.AreEqual(string.Format( | ||
ToolsUIResources.PythonInstaller_BuildPrecursorTable_Python_0_installation_is_required, | ||
_pythonVersion, _toolName), pythonDlg.Message); | ||
|
||
OkDialog(pythonDlg, pythonDlg.OkDialog); | ||
AbstractFunctionalTest.OkDialog(pythonDlg, pythonDlg.OkDialog); | ||
if (!PythonInstallerTaskValidator.ValidateEnableLongpaths()) | ||
{ | ||
MessageDlg longPathDlg = null; | ||
longPathDlg = WaitForOpenForm<MessageDlg>(); | ||
longPathDlg = AbstractFunctionalTest.WaitForOpenForm<MessageDlg>(); | ||
Assert.AreEqual( | ||
string.Format(ToolsUIResources.PythonInstaller_Requesting_Administrator_elevation), | ||
longPathDlg.Message); | ||
|
@@ -114,7 +133,7 @@ public bool InstallPython(BuildLibraryDlg buildLibraryDlg) | |
|
||
RunLongPathsDialog(longPathDlg); | ||
|
||
nvidiaDlg = WaitForOpenForm<MultiButtonMsgDlg>(); | ||
nvidiaDlg = AbstractFunctionalTest.WaitForOpenForm<MultiButtonMsgDlg>(); | ||
|
||
Assert.AreEqual(string.Format(ToolsUIResources.PythonInstaller_Install_Cuda_Library), | ||
nvidiaDlg.Message); | ||
|
@@ -145,7 +164,7 @@ public bool InstallPython(BuildLibraryDlg buildLibraryDlg) | |
{ | ||
Console.WriteLine(@"Info: NVIDIA GPU DETECTED on test node"); | ||
|
||
nvidiaDlg = WaitForOpenForm<MultiButtonMsgDlg>(); | ||
nvidiaDlg = AbstractFunctionalTest.WaitForOpenForm<MultiButtonMsgDlg>(); | ||
Assert.AreEqual(string.Format(ToolsUIResources.PythonInstaller_Install_Cuda_Library), | ||
nvidiaDlg.Message); | ||
RunNvidiaDialog(nvidiaDlg); | ||
|
@@ -160,10 +179,10 @@ public bool InstallPython(BuildLibraryDlg buildLibraryDlg) | |
{ | ||
Console.WriteLine(@"Info: Nvidia libraries already installed"); | ||
} | ||
confirmDlg = WaitForOpenForm<MessageDlg>(600000); | ||
confirmDlg = AbstractFunctionalTest.WaitForOpenForm<MessageDlg>(600000); | ||
//PauseTest("Stop to check which Dialog is open"); | ||
Assert.AreEqual(string.Format(ToolsUIResources.PythonInstaller_OkDialog_Successfully_set_up_Python_virtual_environment), confirmDlg.Message); | ||
OkDialog(confirmDlg, confirmDlg.OkDialog); | ||
AbstractFunctionalTest.OkDialog(confirmDlg, confirmDlg.OkDialog); | ||
if (!confirmDlg.IsDisposed) | ||
confirmDlg.Dispose(); | ||
|
||
|
@@ -185,15 +204,10 @@ public bool InstallPython(BuildLibraryDlg buildLibraryDlg) | |
return false; | ||
} | ||
|
||
protected override void DoTest() | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
private void RunNvidiaDialog(MultiButtonMsgDlg nvidiaDlg) | ||
{ | ||
nvidiaDlg.ClickNo(); | ||
MessageDlg confirmDlg = WaitForOpenForm<MessageDlg>(600000); | ||
MessageDlg confirmDlg = AbstractFunctionalTest.WaitForOpenForm<MessageDlg>(600000); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You should use the change I supplied privately:
As it is, you're running UI code on the test thread, which causes intermittent failures |
||
Assert.AreEqual(string.Format(ToolsUIResources.PythonInstaller_OkDialog_Successfully_set_up_Python_virtual_environment), | ||
confirmDlg.Message); | ||
confirmDlg.OkDialog(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again, you should use the change I provided privately: |
||
|
@@ -204,10 +218,10 @@ private void RunNvidiaDialog(MultiButtonMsgDlg nvidiaDlg) | |
private void RunLongPathsDialog(MessageDlg longPathDlg) | ||
{ | ||
Console.WriteLine(@"Info: Trying to set LongPathsEnabled registry key to 1"); | ||
OkDialog(longPathDlg, longPathDlg.OkDialog); | ||
AbstractFunctionalTest.OkDialog(longPathDlg, longPathDlg.OkDialog); | ||
Console.WriteLine(@"Info: Successfully set LongPathsEnabled registry key to 1"); | ||
_undoRegistry = true; | ||
MessageDlg okDlg = WaitForOpenForm<MessageDlg>(); | ||
MessageDlg okDlg = AbstractFunctionalTest.WaitForOpenForm<MessageDlg>(); | ||
okDlg.OkDialog(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think this is actually reachable code (unless running Skyline as admin, which would be unusual) but this line should be There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if there isn't a way we could let a user who does have sufficient rights to set that registry key - launch a tiny app that does only that, and only works if the user clicks through the OS-provided query about it |
||
|
||
if (!longPathDlg.IsDisposed) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Maintainer" isn't something you'll find anywhere in the rest of the code. Just use "Author", which is Skyline-speak for "owner" or "knows more about it than anyone else, presumably". And, use your proteinms email.