Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[submodule "baselayer"]
path = baselayer
url = git://github.com/cesium-ml/baselayer.git
branch = master
branch = firefox
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll change this to master when we merge the associated baselayer PR.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we merge this into master before continuing?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good - wanna merge my new baselayer PR?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see those tests are failing; do you know why?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stefanv yeah, because those changes break the cesium_web tests, and the fixes are in this PR. So they'll need to be merged simultaneously

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually we'll need to merge this first, then baselayer, then update this to use the master branch.

2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ addons:
- supervisor
- nginx
- xvfb
- chromium-browser
- unzip
- libnss3
- libgconf-2-4
postgresql: "9.6"
firefox: latest

matrix:
include:
Expand Down
17 changes: 10 additions & 7 deletions .travis/travis_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ set -ex

section "install.base.requirements"

# Check Firefox version
firefox --version

# Install v1.7 or newer of nginx to support 'if' statement for logging
sudo apt-add-repository -y ppa:nginx/development
sudo apt update
Expand Down Expand Up @@ -38,12 +41,12 @@ make db_init
section_end "init.db"


section "install.chromedriver.and.selenium"
wget https://chromedriver.storage.googleapis.com/2.37/chromedriver_linux64.zip
sudo unzip chromedriver_linux64.zip chromedriver -d /usr/local/bin
rm chromedriver_linux64.zip
which chromium-browser
chromium-browser --version
section "install.geckodriver.and.selenium"
wget https://github.com/mozilla/geckodriver/releases/download/v0.20.0/geckodriver-v0.20.0-linux64.tar.gz
sudo tar -xzf geckodriver-v0.20.0-linux64.tar.gz -C /usr/local/bin
rm geckodriver-v0.20.0-linux64.tar.gz
which geckodriver
geckodriver --version
pip install --upgrade selenium
python -c "import selenium; print(f'Selenium {selenium.__version__}')"
section_end "install.chromedriver.and.selenium"
section_end "install.geckodriver.and.selenium"
2 changes: 1 addition & 1 deletion baselayer
Submodule baselayer updated 1 files
+12 −17 app/test_util.py
8 changes: 4 additions & 4 deletions cesium_app/tests/frontend/test_predict.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def test_download_prediction_csv_class(driver, project, dataset, featureset,
driver.get('/')
_click_download(project.id, driver)
matching_downloads_paths = glob.glob(f'{cfg["paths:downloads_folder"]}/'
'cesium_prediction_results*.csv')
'cesium_prediction_results*')
assert len(matching_downloads_paths) == 1
try:
npt.assert_equal(
Expand All @@ -180,7 +180,7 @@ def test_download_prediction_csv_class_unlabeled(driver, project, unlabeled_pred
driver.get('/')
_click_download(project.id, driver)
matching_downloads_paths = glob.glob(f'{cfg["paths:downloads_folder"]}/'
'cesium_prediction_results*.csv')
'cesium_prediction_results*')
assert len(matching_downloads_paths) == 1
try:
result = np.genfromtxt(matching_downloads_paths[0], dtype='str')
Expand All @@ -196,7 +196,7 @@ def test_download_prediction_csv_class_prob(driver, project, dataset,
driver.get('/')
_click_download(project.id, driver)
matching_downloads_paths = glob.glob(f'{cfg["paths:downloads_folder"]}/'
'cesium_prediction_results*.csv')
'cesium_prediction_results*')
assert len(matching_downloads_paths) == 1
try:
result = pd.read_csv(matching_downloads_paths[0])
Expand All @@ -218,7 +218,7 @@ def test_download_prediction_csv_regr(driver, project, dataset, featureset,
driver.get('/')
_click_download(project.id, driver)
matching_downloads_paths = glob.glob(f'{cfg["paths:downloads_folder"]}/'
'cesium_prediction_results*.csv')
'cesium_prediction_results*')
assert len(matching_downloads_paths) == 1
try:
results = np.genfromtxt(matching_downloads_paths[0],
Expand Down
29 changes: 19 additions & 10 deletions cesium_app/tests/frontend/test_tooltips.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,46 +11,55 @@ def test_tab_tooltips(driver, project):
hover = ActionChains(driver).move_to_element(
driver.find_element_by_id('react-tabs-0'))
hover.perform()
time.sleep(0.8)
time.sleep(1)
assert driver.find_element_by_xpath(
"//span[contains(text(),'Manage your projects')]"
).is_displayed()

hover = ActionChains(driver).move_to_element(
driver.find_element_by_id('react-tabs-2'))
hover.perform()
time.sleep(0.8)
time.sleep(1)
assert driver.find_element_by_xpath(
"//span[contains(text(),'Upload your time-series data')]"
).is_displayed()

hover = ActionChains(driver).move_to_element(
driver.find_element_by_id('react-tabs-4'))
hover.perform()
time.sleep(0.8)
time.sleep(1)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use our standard approach here for awaiting a new element, instead of doing an explicit sleep?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, the problem with that approach is that the element exists before it is displayed. Thus the sleep here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps, then, we are checking for the wrong thing. Should we check that the element is visible/selected/contains the expected text/whatever is applicable in each instance instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's effectively what we're doing - checking that the element is displayed and contains the expected text.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, but you need to wait until it is updated, otherwise it fails too early. I was hoping for a construct like "wait until this condition is true; but keep trying for at least 5 seconds". Does that exist? I'm merging in the mean time.

assert driver.find_element_by_xpath(
"//span[contains(text(),'Generate features from your time-series data')]"
).is_displayed()


def test_file_upload_tooltips(driver, project):
def test_headerfile_upload_tooltip(driver, project):
driver.get('/')
driver.refresh()
driver.find_element_by_id('react-tabs-2').click()
driver.find_element_by_partial_link_text('Upload new dataset').click()
time.sleep(0.2)

header_file = driver.find_element_by_css_selector('[name=headerFile]')
hover = ActionChains(driver).move_to_element(header_file)
header_file = driver.find_element_by_css_selector('[name="headerFile"]')
hover = ActionChains(driver).click_and_hold(header_file)
hover.perform()
time.sleep(0.8)
time.sleep(1)
assert driver.find_element_by_xpath(
"//span[contains(.,'filename,label')]"
).is_displayed()

tar_file = driver.find_element_by_css_selector('[name=tarFile]')
hover = ActionChains(driver).move_to_element(tar_file)

def DISABLED_test_tarfile_upload_tooltip(driver, project):
driver.get('/')
driver.refresh()
driver.find_element_by_id('react-tabs-2').click()
driver.find_element_by_partial_link_text('Upload new dataset').click()
time.sleep(0.2)

tar_file = driver.find_element_by_css_selector('[name="tarFile"]')
hover = ActionChains(driver).click_and_hold(tar_file)
hover.perform()
time.sleep(0.8)
time.sleep(1)
assert driver.find_element_by_xpath(
"//span[contains(.,'Each file in tarball should be formatted as follows')]"
).is_displayed()
1 change: 1 addition & 0 deletions config.yaml.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ paths:

upload_folder: './data/uploads'
custom_feature_script_folder: './data/uploads/custom_feature_scripts'
downloads_folder: '/tmp'

database:
database: cesium
Expand Down
2 changes: 2 additions & 0 deletions static/js/components/Datasets.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,12 @@ let DatasetForm = (props) => {

<CesiumTooltip
id="headerfileTooltip"
place="right"
text={["filename,label", <br key={1} />, "ts1.dat,class_A", <br key={2} />, "..."]}
/>
<CesiumTooltip
id="tarfileTooltip"
place="right"
text={[
"Each file in tarball should be formatted as follows",
<br />, "(column titles are optional)", <br />, <br />,
Expand Down
2 changes: 1 addition & 1 deletion static/js/components/Tooltip.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ CesiumTooltip.propTypes = {
};
CesiumTooltip.defaultProps = {
place: 'top',
delay: 700
delay: 500
};
export default CesiumTooltip;