Skip to content

Commit ffb7726

Browse files
author
Nate Rush
authored
Merge pull request #1271 from mito-ds/main
Main
2 parents baed7e2 + 3086d54 commit ffb7726

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+560
-402
lines changed
+164
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
name: Pre-release tests
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
test-jupyterlab-demos:
10+
runs-on: ubuntu-20.04
11+
timeout-minutes: 60
12+
strategy:
13+
matrix:
14+
python-version: ['3.7', '3.8', '3.10']
15+
fail-fast: false
16+
17+
steps:
18+
- name: Cancel Previous Runs
19+
uses: styfle/cancel-workflow-action@0.7.0
20+
with:
21+
access_token: ${{ github.token }}
22+
- uses: actions/checkout@v2
23+
- name: Set up Python ${{ matrix.python-version }}
24+
uses: actions/setup-python@v2
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
cache: pip
28+
cache-dependency-path: |
29+
mitosheet/setup.py
30+
tests/requirements.txt
31+
- uses: actions/setup-node@v3
32+
with:
33+
node-version: 16
34+
cache: 'npm'
35+
cache-dependency-path: mitosheet/package-lock.json
36+
- name: Install dependencies
37+
run: |
38+
cd tests
39+
python3 -m venv venv
40+
source venv/bin/activate
41+
pip install mitosheet
42+
pip install --upgrade -i https://test.pypi.org/simple/ mitosheet
43+
# Install necessary node packages
44+
npm install
45+
npx playwright install chromium webkit firefox chrome
46+
47+
- name: Start a server and run tests
48+
run: |
49+
cd tests
50+
source venv/bin/activate
51+
jupyter lab --config jupyter_server_test_config.py &
52+
npm run test:jupyterlab
53+
- name: Upload test-results
54+
uses: actions/upload-artifact@v3
55+
if: failure()
56+
with:
57+
name: jupyterlab-playwright-report-${{ matrix.python-version }}
58+
path: tests/playwright-report/
59+
retention-days: 14
60+
61+
test-streamlit-demos:
62+
timeout-minutes: 60
63+
strategy:
64+
matrix:
65+
os: ['ubuntu-latest', 'macos-latest', 'windows-latest']
66+
python-version: ['3.10']
67+
demo: ['vanguard-fund-performance']
68+
project: ['chromium', 'firefox', 'webkit', 'Google Chrome', 'Microsoft Edge']
69+
exclude:
70+
- os: 'windows-latest'
71+
project: webkit
72+
- os: 'macos-latest'
73+
project: 'Microsoft Edge'
74+
- os: 'ubuntu-latest'
75+
project: 'Microsoft Edge'
76+
- os: 'ubuntu-latest'
77+
project: 'webkit'
78+
fail-fast: false
79+
runs-on: ${{ matrix.os }}
80+
81+
steps:
82+
- uses: actions/checkout@v2
83+
- name: Set up Python ${{ matrix.python-version }}
84+
uses: actions/setup-python@v2
85+
with:
86+
python-version: ${{ matrix.python-version }}
87+
cache: pip
88+
cache-dependency-path: |
89+
mitosheet/setup.py
90+
tests/requirements.txt
91+
tests/extra-requirements.txt
92+
- uses: actions/setup-node@v3
93+
with:
94+
node-version: 16
95+
cache: 'npm'
96+
cache-dependency-path: mitosheet/package-lock.json
97+
- name: Install dependencies (ubuntu, macos)
98+
if: matrix.os != 'windows-latest'
99+
run: |
100+
cd tests
101+
python3 -m venv venv
102+
source venv/bin/activate
103+
pip install mitosheet streamlit
104+
pip install --upgrade -i https://test.pypi.org/simple/ mitosheet
105+
# Install necessary node packages
106+
npm install
107+
npx playwright install chromium webkit firefox chrome
108+
- name: Setup streamlit (ubuntu, macos)
109+
if: matrix.os != 'windows-latest'
110+
run: |
111+
mkdir -p ~/.streamlit/
112+
echo "[general]" > ~/.streamlit/credentials.toml
113+
echo "email = \"\"" >> ~/.streamlit/credentials.toml
114+
- name: Setup streamlit (windows)
115+
if: matrix.os == 'windows-latest'
116+
run: |
117+
$streamlitDir = "$HOME\.streamlit"
118+
if (-not (Test-Path -Path $streamlitDir)) {
119+
New-Item -ItemType Directory -Path $streamlitDir
120+
}
121+
Set-Content -Path "$streamlitDir\credentials.toml" -Value @"
122+
[general]
123+
email = ""
124+
"@
125+
- name: Install dependencies (windows)
126+
if: matrix.os == 'windows-latest'
127+
run: |
128+
cd tests
129+
python3 -m venv venv
130+
.\venv\Scripts\Activate.ps1
131+
pip install mitosheet streamlit
132+
pip install --upgrade -i https://test.pypi.org/simple/ mitosheet
133+
# Install necessary node packages
134+
npm install
135+
npx playwright install chromium webkit firefox chrome
136+
- name: Start a server and run tests (ubuntu, macos)
137+
if: matrix.os != 'windows-latest'
138+
run: |
139+
cd tests
140+
source venv/bin/activate
141+
git clone https://github.com/mito-ds/every-feature-everywhere-all-at-once.git
142+
cd every-feature-everywhere-all-at-once
143+
streamlit run automation-app.py --server.port 8555 &
144+
bash ../check_server.sh
145+
npm run test:streamlit:demo -- --project="${{ matrix.project }}"
146+
- name: Start a server and run tests (windows)
147+
if: matrix.os == 'windows-latest'
148+
run: |
149+
cd tests
150+
.\venv\Scripts\Activate.ps1
151+
152+
git clone https://github.com/mito-ds/every-feature-everywhere-all-at-once.git
153+
cd every-feature-everywhere-all-at-once
154+
Start-Job { streamlit run automation-app.py --server.port 8555 } -WorkingDirectory (Get-Location)
155+
npm run test:streamlit:demo -- --project="${{ matrix.project }}"
156+
- name: Upload test-results
157+
uses: actions/upload-artifact@v3
158+
if: always()
159+
with:
160+
name: streamlit-playwright-report
161+
path: tests/playwright-report/
162+
retention-days: 14
163+
164+

mitosheet/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ Furthermore, if the final `jlpm run watch` or `npm install` command fails, you m
6868
If you are developing on the `mitosheet` package, you can also develop in a Jupyter Notebook. Simply run the comands:
6969

7070
```
71-
jupyter nbextension uninstall mitosheet # NOTE: not sure why this first is needed. Somehow, it gets installed in the setup.py...
71+
jupyter nbextension uninstall mitosheet
7272
jupyter nbextension install --py --symlink --sys-prefix mitosheet
7373
jupyter nbextension enable --py --sys-prefix mitosheet
7474
```

tests/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"main": "index.js",
66
"scripts": {
77
"test:streamlit": "playwright test streamlit_ui_tests --retries=3",
8+
"test:streamlit:demo": "playwright test streamlit_ui_tests/demos --retries=3",
89
"test": "playwright test --retries=3",
910
"test:streamlit:headed": "playwright test streamlit_ui_tests --headed",
1011
"test:dash": "playwright test dash_ui_tests --retries=3 --project=\"chromium\"",
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
import { FrameLocator, Page, expect, test } from '@playwright/test';
2+
import { awaitResponse, clickTab, getMitoFrame } from '../utils';
3+
4+
const createNewColumnWithName = async (page: Page, mito: FrameLocator, name: string) => {
5+
await clickTab(page, mito, 'Home');
6+
await mito.locator('.mito-toolbar-button', { hasText: 'Insert' }).click();
7+
await mito.locator('.endo-column-header-container', { hasText: /new-column/ }).dblclick();
8+
await mito.locator('.endo-column-header-container input').fill(name);
9+
await mito.locator('.endo-column-header-container input').press('Enter', { delay: 100 });
10+
await expect(mito.locator('.endo-column-header-container', { hasText: name })).toBeVisible();
11+
};
12+
13+
test('Vanguard Demo', async ({ page }) => {
14+
const mito = await getMitoFrame(page);
15+
await mito.getByText('Import Files').click();
16+
await mito.getByText('vanguard-fund-performance').dblclick();
17+
await mito.getByText('fund_info.csv').dblclick();
18+
19+
// Add custom import
20+
await clickTab(page, mito, 'Data');
21+
await mito.getByText('Get Performance Data').click();
22+
await mito.locator('.spacing-row', { hasText: 'Username' }).locator('input').fill('username');
23+
await mito.locator('.spacing-row', { hasText: 'Password' }).locator('input').fill('password');
24+
await mito.locator('.spacing-row', { hasText: 'Year' }).locator('input').fill('2020');
25+
await mito.locator('.text-button', { hasText: 'Import Data' }).click();
26+
27+
// Add vlookup of Portfolio Manager to performance data
28+
await mito.getByText('MoM Return').click();
29+
await createNewColumnWithName(page, mito, 'Portfolio Manager');
30+
await mito.locator('.mito-grid-cell[mito-col-index="3"]').first().dblclick();
31+
await mito.locator('#cell-editor-input').fill('=VLOOKUP(');
32+
await mito.locator('.mito-grid-cell[mito-col-index="1"]').first().click();
33+
await mito.locator('#cell-editor-input').pressSequentially(', ');
34+
await mito.locator('.tab', { hasText: 'fund_info' }).click();
35+
await mito.getByText('Fund Name').click();
36+
await mito.getByText('Ongoing Charge').click({ modifiers: ['Shift'] });
37+
await mito.locator('#cell-editor-input').pressSequentially(', 2)');
38+
await mito.locator('#cell-editor-input').press('Enter');
39+
40+
// Use the Separate Row On Delimiter custom edit to split the portfolio managers into separate rows on the delimiter , .
41+
await clickTab(page, mito, 'Custom Edits');
42+
await mito.getByText('Separate Row On Delimiter').click();
43+
await mito.locator('.spacing-row', { hasText: 'Dataframe' }).locator('.select-text').click();
44+
await mito.locator('.mito-dropdown-item', { hasText: 'df1' }).click();
45+
await awaitResponse(page);
46+
await mito.locator('.spacing-row', { hasText: 'Attribute' }).locator('.select-text').click();
47+
await mito.locator('.mito-dropdown-item', { hasText: 'Portfolio Manager' }).click();
48+
await awaitResponse(page);
49+
await mito.locator('.spacing-row', { hasText: 'Delimiter' }).locator('input').fill(',');
50+
await mito.locator('.text-button', { hasText: 'Separate Row on Delimiter' }).click();
51+
await awaitResponse(page);
52+
53+
// Use the GET_EMAIL custom sheet function to get the email of each fund manager
54+
await mito.locator('.endo-column-header-container', { hasText: 'Portfolio Manager' }).click();
55+
await createNewColumnWithName(page, mito, 'Email');
56+
await mito.locator('.mito-grid-cell[mito-col-index="4"]').first().dblclick();
57+
await mito.locator('#cell-editor-input').fill('=GET_EMAIL(');
58+
await mito.locator('.mito-grid-cell[mito-col-index="3"]').first().click();
59+
await mito.locator('#cell-editor-input').press('Enter');
60+
61+
/**
62+
* Create a pivot table with the configuration below:
63+
* Rows: Fund Manager, email, Fund
64+
* Columns: Date (Grouped by Month)
65+
* Values: sum of MoM Return
66+
*/
67+
await mito.locator('.mito-toolbar-button', { hasText: 'Pivot' }).click();
68+
await mito.locator('.spacing-row', { hasText: 'Rows' }).getByText('Add').click();
69+
await mito.locator('.mito-dropdown-item', { hasText: 'Portfolio Manager' }).click();
70+
await mito.locator('.spacing-row', { hasText: 'Rows' }).getByText('Add').click();
71+
await mito.locator('.mito-dropdown-item', { hasText: 'Email' }).click();
72+
await awaitResponse(page);
73+
await mito.locator('.spacing-row', { hasText: 'Rows' }).getByText('Add').click();
74+
await mito.locator('.mito-dropdown-item', { hasText: 'Fund' }).click();
75+
76+
await mito.locator('.spacing-row', { hasText: 'Columns' }).getByText('Add').click();
77+
await mito.locator('.mito-dropdown-item', { hasText: 'Date' }).click();
78+
await awaitResponse(page);
79+
await mito.locator('.spacing-row', { hasText: 'group by' }).locator('.select-text').click();
80+
await mito.locator('.mito-dropdown-item').getByText('month', { exact: true }).click();
81+
await awaitResponse(page);
82+
83+
await mito.locator('.spacing-row', { hasText: 'Values' }).getByText('Add').click();
84+
await mito.locator('.mito-dropdown-item', { hasText: 'MoM Return' }).click();
85+
await awaitResponse(page);
86+
87+
await mito.locator('.select-text', { hasText: 'count' }).click();
88+
await mito.locator('.mito-dropdown-item', { hasText: 'sum' }).click();
89+
90+
await page.locator('.element-container', { hasText: 'Provider Name' }).locator('input').fill('Vanguard');
91+
await page.getByText('Save Automation').click();
92+
93+
});

trymito.io/components/AIThesis/AIThesis.module.css

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
.ai_thesis_container {
2-
margin-top: 8rem;
32
display: flex;
43
flex-direction: column;
54
align-content: center;

trymito.io/components/AIThesis/AIThesis.tsx

+6-5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import pageStyles from '../../styles/Page.module.css'
22
import aiThesisStyles from './AIThesis.module.css'
33
import { useState } from 'react'
44
import ExpandableCard from '../ExpandableCard/ExpandableCard'
5+
import { classNames } from '../../utils/classNames'
56

67

78
const AIThesis = (): JSX.Element => {
@@ -10,12 +11,12 @@ const AIThesis = (): JSX.Element => {
1011

1112
return (
1213

13-
<div className={pageStyles.background_card + ' ' + aiThesisStyles.ai_thesis_container}>
14-
<h2 className='margin-left-2rem'>
15-
Built for AI automation
16-
</h2>
17-
<div className={pageStyles.subsection + ' ' + pageStyles.subsection_narrow_space_betweeen}>
14+
<div className={aiThesisStyles.ai_thesis_container}>
15+
<div className={classNames(pageStyles.subsection, pageStyles.subsection_narrow_space_betweeen)}>
1816
<div>
17+
<h2 className={classNames('margin-left-2rem', 'margin-bottom-1rem')}>
18+
Built for AI automation
19+
</h2>
1920
<ExpandableCard
2021
title={'Sometimes chatbots, sometimes spreadsheets'}
2122
shortTitle={'Choose the right tool'}

trymito.io/components/CTAButtons/CTAButtons.tsx

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import ctaButtons from './CTAButtons.module.css'
55
import { classNames } from '../../utils/classNames';
66

77
const JUPYTERLITE_MITO_LINK = 'https://mito-ds.github.io/mitolite/lab?path=mito.ipynb';
8+
export const CALENDLY_LINK = "https://calendly.com/jake_from_mito/30min";
89

910
const CTAButtons = (props: {
1011
variant: 'download' | 'contact' | 'try jupyterlite' | 'scroll-to-install' | 'book a demo',
@@ -64,15 +65,15 @@ const CTAButtons = (props: {
6465
<div className='only-on-desktop'>
6566
<TextButton
6667
text='Book an Enterprise Demo'
67-
href="https://calendly.com/jake_from_mito/30min"
68+
href={CALENDLY_LINK}
6869
variant='secondary'
6970
className={props.textButtonClassName}
7071
/>
7172
</div>
7273
<div className='only-on-mobile'>
7374
<TextButton
7475
text='Book a Demo'
75-
href="https://calendly.com/jake_from_mito/30min"
76+
href={CALENDLY_LINK}
7677
variant='secondary'
7778
className={props.textButtonClassName}
7879
/>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.case_study_mobile_container {
2+
display: 'flex';
3+
flex-direction: column;
4+
}
5+
6+
.case_study_mobile_container > * {
7+
margin-top: 2rem;
8+
}
9+
10+
11+
.case_studies_table {
12+
width: min(95rem, 100%);
13+
-webkit-border-horizontal-spacing: 30px;
14+
-webkit-border-vertical-spacing: 30px;
15+
}

0 commit comments

Comments
 (0)