|
1 |
| -from comet_ml import API, ui |
| 1 | +%pip install aitk |
| 2 | + |
2 | 3 | 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?") |
3 | 15 |
|
4 |
| -print("1. Trying **to import** additional packages...") |
5 | 16 | 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: |
9 | 20 | 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?") |
13 | 23 | try:
|
14 |
| - import snowflake.connector |
| 24 | + import st_audio_spectrogram |
15 | 25 | print(":white_check_mark: Pass!")
|
16 | 26 | except ImportError:
|
17 |
| - print(":x: Failed! Not a current compute-engine image.") |
| 27 | + print(":x: Failed! Pre-installed packages not found.") |
| 28 | + |
18 | 29 |
|
19 |
| -print("2. Test number of experiments in this project...") |
| 30 | +print("### 4. Test number of experiments in this project?") |
20 | 31 | api = API()
|
21 | 32 | 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?") |
23 | 34 |
|
24 |
| -print("3. You should see a nice message below, not a stack trace:") |
| 35 | +print("### 5. Test parallel imports") |
25 | 36 |
|
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.") |
28 | 41 |
|
| 42 | +if st.button("Restart Session"): |
| 43 | + os.system("pkill -9 python") |
0 commit comments