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

Using selection tool for bsync validation #2240

Merged
merged 6 commits into from
Jun 4, 2020

Conversation

macintoshpie
Copy link
Contributor

@macintoshpie macintoshpie commented Jun 2, 2020

Any background context?

This is the sister-pr to #2234

What's this PR do?

Adds an extra step to validate schema and use case when importing BuildingSync files
Also removes some vestigial front-end code for the old buildingsync import flow.

How should this be manually tested?

These tests should probably be run with and without celery workers, ie in local config include/exclude these lines

CELERY_TASK_ALWAYS_EAGER = True
CELERY_TASK_EAGER_PROPAGATES = True

When testing celery workers, it might be worth setting the log level to debug so messages can be seen: celery ... -l debug. Note that you WON'T see any messages when not running workers

Files for testing:
use_case_data2.zip

single valid file
  • navigate to the data upload modal, click upload buildingsync
  • select the file buildingsync_v2_0_bricr_workflow_GOOD.xml
  • if looking at the network tab of debug tools, it hits /validate_use_cases
  • eventually it should succeed and you should be allowed to go to the mapping page and continue like normal
single valid file with warnings
  • navigate to the data upload modal, click upload buildingsync
  • select this file: buildingsync_v2_0_bricr_workflow_WARNINGS.xml
  • eventually it should SUCCEED and you should be allowed to go to the mapping page and continue like normal. You should ALSO see the warnings listed for the file
single file bad use case
  • first, note the number of imported files for the data set you're going to upload to
  • navigate to the data upload modal, click upload buildingsync
  • select the file ex_1_missing_required.xml
  • eventually it should say it failed to pass validation, and list use case errors and use case warnings, but no schema errors
  • you should only be allowed to dismiss the dialog (not continue to mapping) and if you refresh the data page you should NOT see the number of files increase.
sing file bad schema
  • first, note the number of imported files for the data set you're going to upload to
  • navigate to the data upload modal, click upload buildingsync
  • select the file ex_1_bad_schema.xml
  • eventually it should say it failed to pass validation, and only show schema errors
  • you should only be allowed to dismiss the dialog (not continue to mapping) and if you refresh the data page you should NOT see the number of files increase.
sing file that can't be parsed
  • first, note the number of imported files for the data set you're going to upload to
  • navigate to the data upload modal, click upload buildingsync
  • select the file ex_1_malformed.xml
  • eventually it should say it error out saying the request was unsuccessful (the file isn't parsable)
  • you should only be allowed to dismiss the dialog (not continue to mapping) and if you refresh the data page you should NOT see the number of files increase.
zip file all good
  • navigate to the data upload modal, click upload buildingsync
  • select the file many_all_good.zip
  • eventually it should succeed and you should be allowed to go to the mapping page and continue like normal
zip file one bad
  • first, note the number of imported files for the data set you're going to upload to
  • navigate to the data upload modal, click upload buildingsync
  • select the file many_one_bad.zip
  • eventually it should say it failed to pass validation, and only show use case warnings and errors for the bad file
  • you should only be allowed to dismiss the dialog (not continue to mapping) and if you refresh the data page you should NOT see the number of files increase.
random api issues

These are some things to test if the validation api is down or we get an unexpected response.

  1. test timeout by editing the timeout in building_sync/validation_client.py where the request is being made. Changing it to something like 1 should be sufficient (make sure you restart celery!). When uploading a buildingsync file it should fail saying it timed out
  2. again in validation_client.py test a bad request by tweaking the API url, the default schema version or use case name (again remember to restart celery). These should all result in some sort of failure, and should be reported when trying to upload a buildingsync file

Screenshots (if appropriate)

Example failure
Screen Shot 2020-05-29 at 4 50 41 PM

Example success
Screen Shot 2020-05-29 at 5 11 12 PM

Issues

#2245

@@ -21,7 +21,6 @@
* ng-switch-when="11" == Confirm Save Mappings?
* ng-switch-when="12" == Error Processing Data
* ng-switch-when="13" == Portfolio Manager Import
* ng-switch-when="14" == Successful upload! [BuildingSync]
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed the outdated frontend code for importing buildingsync files

@coveralls
Copy link

coveralls commented Jun 2, 2020

Coverage Status

Coverage decreased (-0.1%) to 76.636% when pulling 646223e on feat/bsync-selection-tool-validation-develop into db6321c on develop.

Copy link
Contributor

@adrian-lara adrian-lara left a comment

Choose a reason for hiding this comment

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

Looks good!

Manual testing listed above is working. Code changes seem mostly identical to the changes made to the bricr branch. Other than small tweaks like to the use case as well as -View method tweak bricr is using an previous version of DRF, I didn't notice any changes when diff'ing the files against bricr-dev.

Let me know if I missed any major differences worth reviewing, otherwise, this is good to merge. 👍

@adrian-lara adrian-lara merged commit ba15b2a into develop Jun 4, 2020
@adrian-lara adrian-lara deleted the feat/bsync-selection-tool-validation-develop branch June 4, 2020 21:36
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.

3 participants