LISTSERV mailing list manager LISTSERV 16.5

Help for QSERV-L Archives


QSERV-L Archives

QSERV-L Archives


QSERV-L@LISTSERV.SLAC.STANFORD.EDU


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

QSERV-L Home

QSERV-L Home

QSERV-L  August 2015

QSERV-L August 2015

Subject:

Re: unit test for wmgr

From:

"Salnikov, Andrei A." <[log in to unmask]>

Reply-To:

General discussion for qserv (LSST prototype baseline catalog)

Date:

Fri, 28 Aug 2015 05:12:59 +0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (1 lines)

Hi Jacek,

I doubt that we can write unit test for every single line of code 
and every possible behavior. Standard problem with that code is
that for correct behavior it needs database instance (and bunch 
of other things because it's Flask stuff) so it's hard to do it 
with standalone setup. The only reasonable wway to test it now is 
the integration test, that is exactly what you do. 

Things could become easier after we switch to sqlalchemy where 
one could substitute sqlite for mysql for testing purposes but it 
will need significant effort to do that (I'm sure our code has 
lots of mysql-specific queries).

What could potentially help in this case is static analysis tool 
like pylint. It's not trivial to use but I try to run it on our 
code and it is very helpful, still it cannot catch 100% of errors 
due to Python dynamic nature.

Cheers,
Andy


Becla, Jacek wrote on 2015-08-27:
> Andy
> 
> I am trying Qserv with the new sqlalchemy based db module.
> 
> Surprisingly everything compiled, built, and all unit tests passed.
> 
> Unsurprisingly, the integration test immediately failed.
> 
> I am addressing this email to you because the first problem
> I ran into is in wmgr
> 
>    File
> "/usr/local/home/becla/stack/repos/qserv_testdata/python/lsst/qserv/tests
> / mysqlDbLoader.py", line 89, in prepareDatabase
>      self.czar_wmgr.dropDb(self._dbName, mustExist=False)
>    File
> "/usr/local/home/becla/stack/repos/qserv/lib/python/lsst/qserv/wmgr/clien
> t .py", line 316, in dropDb
>      self._requestJSON('dbs', dbName, method='DELETE')
>    File
> "/usr/local/home/becla/stack/repos/qserv/lib/python/lsst/qserv/wmgr/clien
> t .py", line 690, in _requestJSON
>      response = self._request(svc, resource, method=method,
> params=params, data=data, headers=headers)
>    File
> "/usr/local/home/becla/stack/repos/qserv/lib/python/lsst/qserv/wmgr/clien
> t .py", line 666, in _request
> 
> 
> which makes me wonder if we could come up with some simple
> unit test to expose this sort of problems.
> 
> Do you have any advice what the easiest way to test / debug it
> would be?
> 
> thanks,
> Jacek
>
  


########################################################################
Use REPLY-ALL to reply to list

To unsubscribe from the QSERV-L list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=QSERV-L&A=1

Top of Message | Previous Page | Permalink

Advanced Options


Options

Log In

Log In

Get Password

Get Password


Search Archives

Search Archives


Subscribe or Unsubscribe

Subscribe or Unsubscribe


Archives

March 2018
February 2018
January 2018
December 2017
August 2017
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013
October 2013
September 2013
August 2013
July 2013
June 2013
May 2013
April 2013
March 2013
February 2013
January 2013
December 2012

ATOM RSS1 RSS2



LISTSERV.SLAC.STANFORD.EDU

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager

Privacy Notice, Security Notice and Terms of Use