Merge lp://qastaging/~kevin-wright-1/u1db-qt/synchronizer-merged-with-trunk-8-aug into lp://qastaging/u1db-qt
- synchronizer-merged-with-trunk-8-aug
- Merge into trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Cris Dywan | ||||
Approved revision: | 126 | ||||
Merged at revision: | 100 | ||||
Proposed branch: | lp://qastaging/~kevin-wright-1/u1db-qt/synchronizer-merged-with-trunk-8-aug | ||||
Merge into: | lp://qastaging/u1db-qt | ||||
Diff against target: |
2776 lines (+2415/-23) 15 files modified
CMakeLists.txt (+2/-2) documentation/u1db.qdocconf (+3/-1) examples/u1db-qt-example-6/u1db-qt-example-6.qdoc (+387/-0) examples/u1db-qt-example-6/u1db-qt-example-6.qml (+173/-0) modules/U1db/CMakeLists.txt (+4/-0) modules/U1db/plugin.cpp (+2/-0) src/CMakeLists.txt (+5/-1) src/database.cpp (+395/-14) src/database.h (+19/-2) src/query.cpp (+16/-0) src/query.h (+2/-0) src/synchronizer.cpp (+1257/-0) src/synchronizer.h (+146/-0) tests/tst_database.qml (+3/-3) tests/tst_query.qml (+1/-0) |
||||
To merge this branch: | bzr merge lp://qastaging/~kevin-wright-1/u1db-qt/synchronizer-merged-with-trunk-8-aug | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot | continuous-integration | Approve | |
Cris Dywan | Approve | ||
Review via email:
|
Commit message
Description of the change
This branch merges the latest trunk with the code for synchronization of databases.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Cris Dywan (kalikiana) wrote : | # |
The code deals with id's being wrapped in {} in places. That's based on behavior of the core code; I think we need a newid() function and solve this in one place.
There's a few instances of the pattern "if (!query.exec()) qDebug" which should probably be using setError.
resetModel can be used in more places currently still doing its equivalent calls.
getValidTargets() and synchronizeTarg
m_errors.
FIXMEs that ought to be sorted out:
##KW## The two lists below are currently not used for anything
##KW## maybe this can be removed as it is replaced by revision_number
Unused code:
//targetDb-
//double target_
This should probably say the real app name + " (U1Db-Qt)"
request.
request.
For good measure processDataFrom
This should not be writable, it's only set internally
Q_PROPERTY(
"where u1db has been downloaded/
This is very ambiguous and doesn't say where to obtain it. It should say
"where the u1db Python reference implemented has been downloaded from lp:u1db"
- 114. By Kevin Wright
-
Removed an unecessary function call and code comment from src/database.cpp.
- 115. By Kevin Wright
-
Removed an unecessary code from src/synchronize
r.cpp, and updated putDoc in src/database.cpp to return QString instead of int. - 116. By Kevin Wright
-
Updated code comments in src/synchronize
r.cpp to be more descriptive with respect to the instructions for how to use the plugin with the python implementation (the server part to be specific). - 117. By Kevin Wright
-
Added 'U1Db-Qt v1.0' to the raw header information sent to the server.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:116
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Kevin Wright (kevin-wright-1) wrote : | # |
Den 08/08/2013 16:24, skrev Christian Dywan:
> Review: Needs Fixing
>
> The code deals with id's being wrapped in {} in places. That's based on behavior of the core code; I think we need a newid() function and solve this in one place.
Agreed. Will add.
> There's a few instances of the pattern "if (!query.exec()) qDebug" which should probably be using setError.
Agreed. Will modify.
>
> resetModel can be used in more places currently still doing its equivalent calls.
Not sure what this comment means.
> getValidTargets() and synchronizeTarg
> m_errors.
The type of errors here are for the benefit of app devs and app users at
the UI level, not console etc. The messages are for use in a QML
application as output from a sync transation to notify re: errors,
warnings and things that went according to plan.
An alternative approach, with broader and more flexible possibilities,
is to have the error information available in a model (QVariantMap) that
includes useful meta data and values (e.g. type of message, message
text, other?). In that way it can be available to app developers as well
as easily adapted for other purposes (e.g. log files, console output).
>
> FIXMEs that ought to be sorted out:
> ##KW## The two lists below are currently not used for anything
> ##KW## maybe this can be removed as it is replaced by revision_number
Both removed.
>
> Unused code:
> //targetDb-
Could not find this one. Perhaps it was deleted in another modification.
> //double target_
This variable is probably needed in upcoming modifications, so it is
there but commented out so it does not produce an annoying warning at
compile time.
>
> This should probably say the real app name + " (U1Db-Qt)"
> request.
> request.
Changed to 'U1Db-Qt v1.0' on both lines. Those two lines may not even be
necessary, as the server may ignore them, but are kept there and posted
anyway for good measure.
>
> For good measure processDataFrom
Not sure it would be needed. If an unexpected key showed up it would be
ignored (as it should be).
>
> This should not be writable, it's only set internally
> Q_PROPERTY(
Agreed. Will modify accordingly.
> "where u1db has been downloaded/
> This is very ambiguous and doesn't say where to obtain it. It should say
> "where the u1db Python reference implemented has been downloaded from lp:u1db"
Changed.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:117
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Cris Dywan (kalikiana) wrote : | # |
> > getValidTargets() and synchronizeTarg
> that's not good if we plan to see errors in console or XML and will make those
> cases harder to deal with. The messages should be predictable without using
> markup - if needed, it's still an option to use regex.
> > m_errors.
> "+index_
>
> The type of errors here are for the benefit of app devs and app users at
> the UI level, not console etc. The messages are for use in a QML
> application as output from a sync transation to notify re: errors,
> warnings and things that went according to plan.
>
> An alternative approach, with broader and more flexible possibilities,
> is to have the error information available in a model (QVariantMap) that
> includes useful meta data and values (e.g. type of message, message
> text, other?). In that way it can be available to app developers as well
> as easily adapted for other purposes (e.g. log files, console output).
Okay, I better see the reasoning now. And I think you're mixing two concepts into here, UI error messages and error handling API for letting developers distinguish errors. The user must not see verbatim key names. And the app developer needs a way to distinguish a failing sync from a bug in his code.
I had a thought in that direction in respect to Database::setError originally. SQL errors aren't interesting to anyone but U1Db-Qt developers - they need to be simple and pastable. The same is often true for U1Db-Qt errors. Errors about invalid id's or json are indeed relevant for developers - but only in the console. There's no need to "handle" them, wrong use of the API is to be fixed. One kind of error that we should have API for is: no space left. I apparently never filed a bug for that.
Now for sync, I'd still want the same console output for obvious mistakes like invalid URLs and wrong key names. That is what I was having in mind when I suggested to not have HTML. It's a one-time see the mistake and fix it and not for UI. And it is useful to always log if a connection failed in any way. For the developer's benefit we should have "signal syncFailed". That should suffice to prompt the user appropriately - the developer knows their target audience, what language to use etc.
> > For good measure processDataFrom
> unexpected i.key() is seen?
>
> Not sure it would be needed. If an unexpected key showed up it would be
> ignored (as it should be).
I should clarify: if an unexpected key turns up that's a bug in the code. Q_ASSERT is better I guess.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Kevin Wright (kevin-wright-1) wrote : | # |
Den 08/08/2013 17:32, skrev Christian Dywan:
> Review: Needs Fixing
>
>
>>> For good measure processDataFrom
>> unexpected i.key() is seen?
>>
>> Not sure it would be needed. If an unexpected key showed up it would be
>> ignored (as it should be).
> I should clarify: if an unexpected key turns up that's a bug in the code. Q_ASSERT is better I guess.
In fact there are other key and value pairs that the server does return
that are not yet being used by the Synchronizer class.
Of course it is harmless to notify that there is more information than
expected (or in this case information that is expected but not being
used), and discounting the possibility that at some point in time there
might be a benefit to doing so would not be wise.
For the record though, in this particular case, if there were an
unexpected key (and associated value) that turns up it is because it was
information delivered directly from the server.
Kevin
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Kevin Wright (kevin-wright-1) wrote : | # |
Den 08/08/2013 17:32, skrev Christian Dywan:
> Review: Needs Fixing
>
>>> getValidTargets() and synchronizeTarg
>> that's not good if we plan to see errors in console or XML and will make those
>> cases harder to deal with. The messages should be predictable without using
>> markup - if needed, it's still an option to use regex.
>>> m_errors.
>> "+index_
>>
>> The type of errors here are for the benefit of app devs and app users at
>> the UI level, not console etc. The messages are for use in a QML
>> application as output from a sync transation to notify re: errors,
>> warnings and things that went according to plan.
>>
>> An alternative approach, with broader and more flexible possibilities,
>> is to have the error information available in a model (QVariantMap) that
>> includes useful meta data and values (e.g. type of message, message
>> text, other?). In that way it can be available to app developers as well
>> as easily adapted for other purposes (e.g. log files, console output).
> Okay, I better see the reasoning now. And I think you're mixing two concepts into here, UI error messages and error handling API for letting developers distinguish errors. The user must not see verbatim key names. And the app developer needs a way to distinguish a failing sync from a bug in his code.
The messages can and should be modified. But the app developer does not
need to necessarily use the log/error/warning output from sync in its
raw form either. It should be up to the developer to determine how they
want to work with the data.
>
> I had a thought in that direction in respect to Database::setError originally. SQL errors aren't interesting to anyone but U1Db-Qt developers - they need to be simple and pastable. The same is often true for U1Db-Qt errors. Errors about invalid id's or json are indeed relevant for developers - but only in the console. There's no need to "handle" them, wrong use of the API is to be fixed. One kind of error that we should have API for is: no space left. I apparently never filed a bug for that.
>
> Now for sync, I'd still want the same console output for obvious mistakes like invalid URLs and wrong key names. That is what I was having in mind when I suggested to not have HTML. It's a one-time see the mistake and fix it and not for UI. And it is useful to always log if a connection failed in any way. For the developer's benefit we should have "signal syncFailed". That should suffice to prompt the user appropriately - the developer knows their target audience, what language to use etc.
Assuming too much about what the app developer wants, the endless
possible types of errors that might be encountered (e.g. faulty app
logic, user input variations, API problems), or who their audience is,
along rigid lines (and then use that logic for designing the API), may
be asking for trouble. What one developer to the next might want (or
need) could be different enough that "signal syncFailed" isn't enough.
This is why I suggested having a much more flexible and less
discriminating approach of making the data vailable using QVarientMap,...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Cris Dywan (kalikiana) wrote : | # |
> Assuming too much about what the app developer wants, the endless
> possible types of errors that might be encountered (e.g. faulty app
> logic, user input variations, API problems), or who their audience is,
> along rigid lines (and then use that logic for designing the API), may
> be asking for trouble. What one developer to the next might want (or
> need) could be different enough that "signal syncFailed" isn't enough.
> This is why I suggested having a much more flexible and less
> discriminating approach of making the data vailable using QVarientMap,
> with meta data included so u1db dev and app dev can use the information
> in ways they choose, for the ultimate benefit of the end user.
>
> The existing approach is indeed immature in that respect, but the
> suggestion of using a model (QVarientMap) moves beyond current
> limitations and is flexible enough for a broad set of use cases, some of
> which we cannot anticipate on our own, but without creating huge overhead.
>
> It is intended to provide a rich mechanism for developers to create
> robust applications for users that do more than simply give feedback
> that only says "fail". Additionally it can hopefully provide useful
> information for u1db-qt devs as well (who also might happen to build
> apps with the plugin...including examples).
syncFailed was an example only. And I stress free-form strings are not a basis for proper error handling API.
At this point I'd prefer to only use simple qDebug() calls and leave proper error API for a separate task. I created bugs for this: bug 1210448 and bug 1210450.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Cris Dywan (kalikiana) wrote : | # |
These are the doc errors I'm currently seeing with the latest changes. They need to be resolve before the branch can be merged:
./src/database.
[Maybe you meant '\part'?]
./src/database.
[Maybe you meant '\part'?]
./src/database.
[Maybe you meant '\part'?]
./src/synchroni
./src/synchroni
./src/synchroni
./src/synchroni
./src/synchroni
./src/synchroni
./src/synchroni
[Maybe you meant '\part'?]
./src/synchroni
[Maybe you meant '\part'?]
./src/synchroni
./src/synchroni
[Maybe you meant '\part'?]
./src/synchroni
[Maybe you meant '\part'?]
./src/synchroni
[Maybe you meant '\part'?]
./src/synchroni
[Maybe you meant '\part'?]
./src/database.
./src/database.
./src/database.
./src/database.
./src/database.
./src/database.
./src/database.
./src/database.
./src/database.
./src/database.
./src/database.
./src/query.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Kevin Wright (kevin-wright-1) wrote : | # |
[snip]
>
> The existing approach is indeed immature in that respect, but the
> suggestion of using a model (QVarientMap) moves beyond current
> limitations and is flexible enough for a broad set of use cases, some of
> which we cannot anticipate on our own, but without creating huge overhead.
>
> It is intended to provide a rich mechanism for developers to create
> robust applications for users that do more than simply give feedback
> that only says "fail". Additionally it can hopefully provide useful
> information for u1db-qt devs as well (who also might happen to build
> apps with the plugin...including examples).
> syncFailed was an example only. And I stress free-form strings are not a basis for proper error handling API.
>
> At this point I'd prefer to only use simple qDebug() calls and leave proper error API for a separate task. I created bugs for this: bug 1210448 and bug 1210450.
I modified things already.
I renamed it sync_output instead of errors (since not everything was an
error), and changed it so that a QVariantMap is returned (rather than
QString) with various meta data, depending on the sync output. There is
a descriptive message for each sync_output record, but it comes along
with hard data, such as what property is related to the message, any
particulars about the database (e.g. name, its index within the targets
definition). Additionally the messages themselves have been modified,
with some former details that were included in the description pushed to
the various meta-data instead. A set of error IDs could be created as well.
The information can be used at the application level, or used by methods
within the plugin itself (e.g. console output, log file).
I'll push those changes since they over write the original error
handling that needed removal/
Kevin
- 118. By Kevin Wright
-
Modified 'errors'. Changed to 'sync_output' (since not everything was an error); changed from QString to QVariantMap that includes more meta-data; and created more generic output descriptions (i.e. removed most hard data and placed into meta-data instead). This approach is still primarily intented as a mechanism for application developers to troubleshoot (or simply keep themselves/users informed of background activity), but can be utilized within the plugin itself as well (e.g. log files, console output). It does not presently include error codes (where appropriate) but should, and additionally it needs to be documented so people can take advantage of it and use it properly. The example u1db-qt-
example- 6.qml uses it as of this commit, but is only applying the output message and not any of the meta-data.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Cris Dywan (kalikiana) wrote : | # |
> The information can be used at the application level, or used by methods
> within the plugin itself (e.g. console output, log file).
>
> I'll push those changes since they over write the original error
> handling that needed removal/
Nice stuff actually. Much cleaner than I expected! It should lend itself extremely nicely for test cases as well. I wouldn't have expected this in this MR but I'm not going to complain now ;-)
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:118
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 119. By Kevin Wright
-
Modified several source files to fix warnings from qdoc.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Kevin Wright (kevin-wright-1) wrote : | # |
Den 09/08/2013 11:20, skrev Christian Dywan:
> These are the doc errors I'm currently seeing with the latest changes. They need to be resolve before the branch can be merged:
>
> ./src/database.
> [Maybe you meant '\part'?]
> ./src/database.
> [Maybe you meant '\part'?]
> ./src/database.
> [Maybe you meant '\part'?]
> ./src/synchroni
> ./src/synchroni
> ./src/synchroni
> ./src/synchroni
> ./src/synchroni
> ./src/synchroni
> ./src/synchroni
> [Maybe you meant '\part'?]
> ./src/synchroni
> [Maybe you meant '\part'?]
> ./src/synchroni
> ./src/synchroni
> [Maybe you meant '\part'?]
> ./src/synchroni
> [Maybe you meant '\part'?]
> ./src/synchroni
> [Maybe you meant '\part'?]
> ./src/synchroni
> [Maybe you meant '\part'?]
> ./src/database.
> ./src/database.
> ./src/database.
> ./src/database.
> ./src/database.
> ./src/database.
> ./src/database.
> ./src/database.
> ./src/database.
> ./src/database.
> ./src/database.
> ./src/query.
Hopefully all fixed now. Could not find anything specific to resolve the
warnings about \property, but maybe this is resolved by the change to
fix the warning about \class.
Also \param is used elsewhere in source files, but perhaps was not used
properly in these instances. The references have been remov...
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Kevin Wright (kevin-wright-1) wrote : | # |
Den 08/08/2013 16:24, skrev Christian Dywan:
> Review: Needs Fixing
>
> The code deals with id's being wrapped in {} in places. That's based on behavior of the core code; I think we need a newid() function and solve this in one place.
>
Have not done anything about this. I'm not sure it needs attending to
ahead of higher priority items.
> There's a few instances of the pattern "if (!query.exec()) qDebug" which should probably be using setError.
Have not added any new qDebug messages yet.
>
> resetModel can be used in more places currently still doing its equivalent calls.
Still unsure about this comment -- maybe it was mentioned in another thread.
>
> getValidTargets() and synchronizeTarg
> m_errors.
Discussed in another thread. Has been changed completely. No more markup
is included in output messages.
>
> FIXMEs that ought to be sorted out:
> ##KW## The two lists below are currently not used for anything
> ##KW## maybe this can be removed as it is replaced by revision_number
Already removed.
>
> Unused code:
> //targetDb-
Already removed?
> //double target_
Already commented on this -- variable might be used in further
modifications. Commented out to avoid seeing warning during builds.
> This should probably say the real app name + " (U1Db-Qt)"
> request.
> request.
Already fixed.
>
> For good measure processDataFrom
Have not touched this -- will add an else clause.
>
> This should not be writable, it's only set internally
> Q_PROPERTY(
Modified to sync_output, QList<QVariant> and read only (commit message
has more details).
>
> "where u1db has been downloaded/
> This is very ambiguous and doesn't say where to obtain it. It should say
> "where the u1db Python reference implemented has been downloaded from lp:u1db"
Already fixed.
Kevin
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Kevin Wright (kevin-wright-1) wrote : | # |
Den 09/08/2013 12:50, skrev Christian Dywan:
>> The information can be used at the application level, or used by methods
>> within the plugin itself (e.g. console output, log file).
>>
>> I'll push those changes since they over write the original error
>> handling that needed removal/
> Nice stuff actually. Much cleaner than I expected! It should lend itself extremely nicely for test cases as well. I wouldn't have expected this in this MR but I'm not going to complain now ;-)
It was actually quite easy to implement. Took less than 30 minutes to
put together.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:119
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 120. By Kevin Wright
-
Modified database.cpp so that all query.exec() statements have either qDebug output of the error message, or are covered by setError. Eventually error handling should be more consistant, and perhaps utilize the same mechanism as sync_output in the Synchronizer class. Some functions in Database are used side by side with other functions in Synchronizer, so perhaps this is a wise idea where applicable.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Kevin Wright (kevin-wright-1) wrote : | # |
>> There's a few instances of the pattern "if (!query.exec()) qDebug"
>> which should probably be using setError.
>
> Have not added any new qDebug messages yet.
Whoops. Misread this one. Added qDebug statements where there was
nothing. Will fix to use setError.
Kevin
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:120
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Kevin Wright (kevin-wright-1) wrote : | # |
Den 09/08/2013 13:48, skrev Kevin Wright:
>>> There's a few instances of the pattern "if (!query.exec()) qDebug"
>>> which should probably be using setError.
>> Have not added any new qDebug messages yet.
> Whoops. Misread this one. Added qDebug statements where there was
> nothing. Will fix to use setError.
>
> Kevin
>
Hopefully all done now.
Kevin
- 121. By Kevin Wright
-
Modified database.cpp so that all query.exec() statements are covered by setError. Unfortunately setSerror cannot be the return value in some places, because the method is void or something other than a string.
- 122. By Kevin Wright
-
Modified database.cpp to fix a small bug re: setError.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:122
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Cris Dywan (kalikiana) wrote : | # |
> Den 09/08/2013 11:20, skrev Christian Dywan:
> > These are the doc errors I'm currently seeing with the latest changes. They
> need to be resolve before the branch can be merged:
> Hopefully all fixed now. Could not find anything specific to resolve the
> warnings about \property, but maybe this is resolved by the change to
> fix the warning about \class.
>
> Also \param is used elsewhere in source files, but perhaps was not used
> properly in these instances. The references have been removed in the
> latest commit, but perhaps this needs to be looked at again.
There's still 17 qdoc warnings. See https:/
- 123. By Kevin Wright
-
Changed qdoc markup class to qmlclass in synchronizer.cpp.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:123
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 124. By Kevin Wright
-
Fixed qdoc warnings.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:124
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Cris Dywan (kalikiana) wrote : | # |
I get a unit test failure with the latest update:
<testcase result="fail" name="U1dbDatab
<failure message="Compared values are not the same
Actual (): false
Expected (): true" result="fail"/>
</testcase>
Running "qmltestrunner -import ./_build/modules -input ./tests" gives me the line number:
tests/tst_
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Kevin Wright (kevin-wright-1) wrote : | # |
Den 12/08/2013 11:26, skrev Christian Dywan:
> Review: Needs Fixing
>
> I get a unit test failure with the latest update:
>
> <testcase result="fail" name="U1dbDatab
> <failure message="Compared values are not the same
> Actual (): false
> Expected (): true" result="fail"/>
> </testcase>
>
> Running "qmltestrunner -import ./_build/modules -input ./tests" gives me the line number:
>
> tests/tst_
The test message seems ambiguous.
Compared values of what?
Kevin
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Cris Dywan (kalikiana) wrote : | # |
There's also Jenkins brokenness with precise:
Err http://
404 Not Found
Not at all related to u1db-qt - I'm investigating what we can do there.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Cris Dywan (kalikiana) wrote : | # |
> Den 12/08/2013 11:26, skrev Christian Dywan:
> > Review: Needs Fixing
> >
> > I get a unit test failure with the latest update:
> >
> > <testcase result="fail" name="U1dbDatab
> > <failure message="Compared values are not the same
> > Actual (): false
> > Expected (): true" result="fail"/>
> > </testcase>
> >
> > Running "qmltestrunner -import ./_build/modules -input ./tests" gives me the
> line number:
> >
> > tests/tst_
>
> The test message seems ambiguous.
>
> Compared values of what?
Tell me about it, hte default messages of qmltestrunner suck :-(
But the line is:
compare(
So that translates to "Expected -1 but got something else from putDoc()"
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Kevin Wright (kevin-wright-1) wrote : | # |
Den 12/08/2013 11:35, skrev Christian Dywan:
>> Den 12/08/2013 11:26, skrev Christian Dywan:
>>> Review: Needs Fixing
>>>
>>> I get a unit test failure with the latest update:
>>>
>>> <testcase result="fail" name="U1dbDatab
>>> <failure message="Compared values are not the same
>>> Actual (): false
>>> Expected (): true" result="fail"/>
>>> </testcase>
>>>
>>> Running "qmltestrunner -import ./_build/modules -input ./tests" gives me the
>> line number:
>>> tests/tst_
>> The test message seems ambiguous.
>>
>> Compared values of what?
> Tell me about it, hte default messages of qmltestrunner suck :-(
> But the line is:
>
> compare(
>
> So that translates to "Expected -1 but got something else from putDoc()"
Yep, found it. putDoc returns a QString, but the test expects bool.
Not sure how to modify the test properly because the return value is
based on the UID of the database, which will be different with each new
database created -- in addition the function that retrieves the database
UID is private, so unless that is made public the only thing that could
be tested for is whether the return string is empty or not. Well, if the
return string contains ":1" that could also be tested for -- not quite a
good test but perhaps better than nothing.
Kevin
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Cris Dywan (kalikiana) wrote : | # |
> > compare(
> true)
> >
> > So that translates to "Expected -1 but got something else from putDoc()"
> Yep, found it. putDoc returns a QString, but the test expects bool.
>
> Not sure how to modify the test properly because the return value is
> based on the UID of the database, which will be different with each new
> database created -- in addition the function that retrieves the database
> UID is private, so unless that is made public the only thing that could
> be tested for is whether the return string is empty or not. Well, if the
> return string contains ":1" that could also be tested for -- not quite a
> good test but perhaps better than nothing.
It sounds sensible to check the empty string - the test only checks if it succeeds or not at the moment. I would leave it to a separate task to extend it to see if that id is valid, works, etc.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Kevin Wright (kevin-wright-1) wrote : | # |
Den 12/08/2013 11:55, skrev Christian Dywan:
>>> compare(
>> true)
>>> So that translates to "Expected -1 but got something else from putDoc()"
>> Yep, found it. putDoc returns a QString, but the test expects bool.
>>
>> Not sure how to modify the test properly because the return value is
>> based on the UID of the database, which will be different with each new
>> database created -- in addition the function that retrieves the database
>> UID is private, so unless that is made public the only thing that could
>> be tested for is whether the return string is empty or not. Well, if the
>> return string contains ":1" that could also be tested for -- not quite a
>> good test but perhaps better than nothing.
> It sounds sensible to check the empty string - the test only checks if it succeeds or not at the moment. I would leave it to a separate task to extend it to see if that id is valid, works, etc.
I misunderstood slightly what the original test was looking for...it was
checking for an int actually, and whether it was > -1. In any case I
have changed it to check the return string and whether != empty string.
The qmltestrunner program seems to hang sometimes. It is difficult to
know if it is running or not. Is that normal?
Kevin
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Kevin Wright (kevin-wright-1) wrote : | # |
Den 12/08/2013 12:02, skrev <email address hidden>:
> Den 12/08/2013 11:55, skrev Christian Dywan:
>>>> compare(
>>>> -1,
>>> true)
>>>> So that translates to "Expected -1 but got something else from
>>>> putDoc()"
>>> Yep, found it. putDoc returns a QString, but the test expects bool.
>>>
>>> Not sure how to modify the test properly because the return value is
>>> based on the UID of the database, which will be different with each new
>>> database created -- in addition the function that retrieves the
>>> database
>>> UID is private, so unless that is made public the only thing that could
>>> be tested for is whether the return string is empty or not. Well, if
>>> the
>>> return string contains ":1" that could also be tested for -- not
>>> quite a
>>> good test but perhaps better than nothing.
>> It sounds sensible to check the empty string - the test only checks
>> if it succeeds or not at the moment. I would leave it to a separate
>> task to extend it to see if that id is valid, works, etc.
> I misunderstood slightly what the original test was looking for...it
> was checking for an int actually, and whether it was > -1. In any case
> I have changed it to check the return string and whether != empty string.
>
> The qmltestrunner program seems to hang sometimes. It is difficult to
> know if it is running or not. Is that normal?
>
> Kevin
>
>
Checking for an empty string does not appear to be working no matter
which way I try. Will keep at it.
However, it also appears that there is a check for the file name of the
database. The test is only the name of the file itself, but the value
recieved appears to be the absolute path.
Kevin
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Kevin Wright (kevin-wright-1) wrote : | # |
Den 12/08/2013 12:22, skrev <email address hidden>:
> Den 12/08/2013 12:02, skrev <email address hidden>:
>> Den 12/08/2013 11:55, skrev Christian Dywan:
>>>>> compare(
>>>>> > -1,
>>>> true)
>>>>> So that translates to "Expected -1 but got something else from
>>>>> putDoc()"
>>>> Yep, found it. putDoc returns a QString, but the test expects bool.
>>>>
>>>> Not sure how to modify the test properly because the return value is
>>>> based on the UID of the database, which will be different with each
>>>> new
>>>> database created -- in addition the function that retrieves the
>>>> database
>>>> UID is private, so unless that is made public the only thing that
>>>> could
>>>> be tested for is whether the return string is empty or not. Well,
>>>> if the
>>>> return string contains ":1" that could also be tested for -- not
>>>> quite a
>>>> good test but perhaps better than nothing.
>>> It sounds sensible to check the empty string - the test only checks
>>> if it succeeds or not at the moment. I would leave it to a separate
>>> task to extend it to see if that id is valid, works, etc.
>> I misunderstood slightly what the original test was looking for...it
>> was checking for an int actually, and whether it was > -1. In any
>> case I have changed it to check the return string and whether !=
>> empty string.
>>
>> The qmltestrunner program seems to hang sometimes. It is difficult to
>> know if it is running or not. Is that normal?
>>
>> Kevin
>>
>>
> Checking for an empty string does not appear to be working no matter
> which way I try. Will keep at it.
>
> However, it also appears that there is a check for the file name of
> the database. The test is only the name of the file itself, but the
> value recieved appears to be the absolute path.
Scratch this last one. Seems to be a misunderstanding.
>
> Kevin
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Cris Dywan (kalikiana) wrote : | # |
> There's also Jenkins brokenness with precise:
> Err http://
> 404 Not Found
>
> Not at all related to u1db-qt - I'm investigating what we can do there.
FYI A work-around for the issue is in place (real fix will take longer). The next automated build should run fine.
- 125. By Kevin Wright
-
Modified tests. In one instance a query property was missing from a Query element (in tst_query.qml), and in another occurance the test needed to be updated to reflect a different return value (in test_database.qml).
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:125
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 126. By Kevin Wright
-
Fixed one test to remove a warning.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:126
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
Cris Dywan (kalikiana) wrote : | # |
ERROR: No artifacts found that match the file pattern "**/*test*.xml". Configuration error?
ERROR: '**/*test*.xml' doesn't match anything: '**' exists but not '**/*test*.xml'
I'm seeing to get this sorted. As far as I'm concerned, the build, tests and docs pass and this is down to Jenkins.
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:126
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:126
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:126
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
![](/+icing/build/overlay/assets/skins/sam/images/close.gif)
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:126
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
FAILED: Continuous integration, rev:113 jenkins. qa.ubuntu. com/job/ u1db-qt- ci/1/ jenkins. qa.ubuntu. com/job/ u1db-qt- precise- amd64-ci/ 1/console jenkins. qa.ubuntu. com/job/ u1db-qt- quantal- amd64-ci/ 1/console jenkins. qa.ubuntu. com/job/ u1db-qt- raring- amd64-ci/ 1/console jenkins. qa.ubuntu. com/job/ u1db-qt- saucy-amd64- ci/1/console jenkins. qa.ubuntu. com/job/ u1db-qt- saucy-armhf- ci/1/console
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: s-jenkins: 8080/job/ u1db-qt- ci/1/rebuild
http://