dmwm / DBS

CMS Dataset Bookkeeping Service
Apache License 2.0
7 stars 21 forks source link

DBS Client unittest #572

Closed ticoann closed 6 years ago

ticoann commented 6 years ago

@yuyiguo, Please review

cmsdmwmbot commented 6 years ago

Jenkins results:

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/DMWM-DBS-PR-test/72/artifact/artifacts/PullRequestReport.html

cmsdmwmbot commented 6 years ago

Jenkins results:

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/DMWM-DBS-PR-test/73/artifact/artifacts/PullRequestReport.html

ticoann commented 6 years ago

@yuyiguo, Yuyi, Serverside unittest is already included. I will add more validation check. You are taking about input validation right? child id has to be in the same block. The only problem is I have get the id some how first. Currently it seems only way is that listFiles with detail option True.

ticoann commented 6 years ago

All validation are added. If you want to do more input validation let me know.

cmsdmwmbot commented 6 years ago

Jenkins results:

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/DMWM-DBS-PR-test/76/artifact/artifacts/PullRequestReport.html

cmsdmwmbot commented 6 years ago

Jenkins results:

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/DMWM-DBS-PR-test/79/artifact/artifacts/PullRequestReport.html

ticoann commented 6 years ago

@yuyiguo, patch is updated as you suggested. However there is a bug on unittest.

https://github.com/dmwm/DBS/blob/master/Server/Python/tests/dbsserver_t/utils/DBSRestApi.py#L138

This is raising Exception although it says raising HTTPError.
So I can't really to asserRaise(HTTPError). I try to fix is by just changing Exception to HTTPError. But there are underlining structure also need to be changed.

======================================================================
ERROR: test12a (dbsserver_t.unittests.web_t.DBSWriterModel_t.DBSWriterModel_t)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/afs/cern.ch/user/s/sryu/DBS/Server/Python/tests/dbsserver_t/unittests/web_t/DBSWriterModel_t.py", line 103, in wrapper
    if self.msg not in ex.args[0]:
TypeError: argument of type 'int' is not iterable

For now I just catch Exception instead of HTTPError.