Skip to content
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

Informative errors on qiita_env #157

Merged
merged 11 commits into from
Jun 21, 2014
Merged

Conversation

josenavas
Copy link
Contributor

Fixes #140

I've also noticed that qiita_env make_demo_env now takes a while since it has to download the data files. Since this can be annoying to the user, I've added some print statements such that the user know what is the script doing. Here is an example:

$ qiita_env make_demo_env
Creating database
Building SQL layout
Initializing database
Populating database with demo data (1/2)
Downloading test files
Extracting files
Populating database with demo data (2/2)
Demo environment successfully created

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.72%) when pulling d5312be on josenavas:issue140 into 704b843 on biocore:master.

@@ -142,6 +170,13 @@ def make_demo_environment(base_data_dir, base_work_dir, user, password, host):
conn.set_isolation_level(ISOLATION_LEVEL_AUTOCOMMIT)
# Create the database
cur = conn.cursor()
# First check if the qiita_demo database already exists
if _check_db_exists('qiita_demo', cur):
raise QiitaEnvironmentError(
Copy link
Member

Choose a reason for hiding this comment

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

I don't think the script should error, it should just print a message saying that there's nothing to do and hinting to qiita_env drop_demo_env.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@ElDeveloper
Copy link
Member

I've also noticed that qiita_env make_demo_env now takes a while since it has to download the data files. Since this can be annoying to the user, I've added some print statements such that the user know what is the script doing. Here is an example:

Would be cool to figure out a way to use click's progress bars, note that these are only available in click 2.0.

@josenavas
Copy link
Contributor Author

Thanks @ElDeveloper I'll take a look tomorrow. I'm falling asleep...

@@ -33,6 +34,21 @@
POPULATE_FP = get_support_file('populate_test_db.sql')


def _check_db_exists(db, cursor):
Copy link
Member

Choose a reason for hiding this comment

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

This sections validates all possible env in a specific way vs. querying a conf or something to know what are the possible env, which will make difficult to add/delete for good more environments, can you change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think done :P

@josenavas
Copy link
Contributor Author

@ElDeveloper see #161

@josenavas
Copy link
Contributor Author

Fixes #159

@josenavas
Copy link
Contributor Author

Fixes #157

@josenavas
Copy link
Contributor Author

Fixes #156

@squirrelo
Copy link
Contributor

👍 if tests pass

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.18%) when pulling f154a47 on josenavas:issue140 into a6f1174 on biocore:master.

squirrelo added a commit that referenced this pull request Jun 21, 2014
Informative errors on qiita_env
@squirrelo squirrelo merged commit 84cea69 into qiita-spots:master Jun 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

better error when demo database already exists
5 participants