Skip to content

Commit 3c130c3

Browse files
authored
Update SmokeTest.py
Updated for new tests
1 parent 2b27cfb commit 3c130c3

File tree

1 file changed

+30
-15
lines changed

1 file changed

+30
-15
lines changed

panels/SmokeTest.py

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,43 @@
1-
from comet_ml import API, ui
1+
%pip install aitk
2+
23
import os
4+
from comet_ml import API
5+
6+
st.markdown("## Smoke Tests")
7+
8+
print("You are running compute engine %s" % os.environ["ENGINE_VERSION"])
9+
10+
11+
st.markdown("### 1. Using `%pip magic` to install additional packages?")
12+
print(":white_check_mark: Pass! `%pip` works")
13+
14+
st.markdown("### 2. Import additional packages?")
315

4-
print("1. Trying **to import** additional packages...")
516
try:
6-
import st_audio_spectrogram
7-
print(":white_check_mark: Pass!")
8-
except ImportError:
17+
import aitk
18+
print(":white_check_mark: Pass! Can `import` %pip-installed packages")
19+
except Exception:
920
print(":x: Failed! Not a current compute-engine image.")
10-
11-
print("2. Trying **to install** and **import** additional packages...")
12-
os.system("pip install snowflake-connector-python")
21+
22+
st.markdown("### 3. Import pre-installed packages?")
1323
try:
14-
import snowflake.connector
24+
import st_audio_spectrogram
1525
print(":white_check_mark: Pass!")
1626
except ImportError:
17-
print(":x: Failed! Not a current compute-engine image.")
27+
print(":x: Failed! Pre-installed packages not found.")
28+
1829

19-
print("2. Test number of experiments in this project...")
30+
print("### 4. Test number of experiments in this project?")
2031
api = API()
2132
count = api.get_panel_experiments()
22-
print(f"There are {len(count)} experiments in this project. Is this correct?")
33+
print(f"There should be {len(count)} experiments selected in this project. Is this correct?")
2334

24-
print("3. You should see a nice message below, not a stack trace:")
35+
print("### 5. Test parallel imports")
2536

26-
api = API("645645")
27-
api.get_workspaces()
37+
print("Add two copies of this Smoke Test panel to this view," +
38+
" and save the view.")
39+
print("Press the **Restart Session** button below and refresh your browser.")
40+
print("The two panels should load, first one, then the other.")
2841

42+
if st.button("Restart Session"):
43+
os.system("pkill -9 python")

0 commit comments

Comments
 (0)