-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
FdoSecrets: Add unit tests for secret service integration #4232
FdoSecrets: Add unit tests for secret service integration #4232
Conversation
2d71cc5
to
d167be0
Compare
Enough fighting CI for today 🤦♂️. The last issue seems to be missing dbus-run-session in the CI environment. |
Easy fix, we can add that. Are there any version constraints? |
Just did a quick search, on ubuntu, |
d167be0
to
9cc5e58
Compare
9cc5e58
to
82de2f2
Compare
82de2f2
to
000b149
Compare
Ping. I rebased this on the latest |
If the tests pass I'll merge it :-D |
Cool! Thanks for reviewing. This depends on #4776 to correctly cleanup between test cases, though. |
Merged that one, please rebase again |
000b149
to
c568671
Compare
The failure in CI seems unrelated in |
Yah sometimes those trip for random reasons |
🐈
…On Mon, May 25, 2020, 8:03 PM Aetf ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/gui/DatabaseTabWidget.cpp
<#4232 (comment)>
:
> @@ -49,7 +49,7 @@ DatabaseTabWidget::DatabaseTabWidget(QWidget* parent)
: QTabWidget(parent)
, m_dbWidgetStateSync(new DatabaseWidgetStateSync(this))
, m_dbWidgetPendingLock(nullptr)
- , m_databaseOpenDialog(new DatabaseOpenDialog())
+ , m_databaseOpenDialog(new DatabaseOpenDialog(this))
Because otherwise, the testing code has no way to access the database open
dialog. And changing from using a QScopedPointer to using QObject parent
should not change the lifetime of DatabaseOpenDialog in any
non-negligible way.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#4232 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFUITJITVFGFLHGCZTPZTE3RTKXINANCNFSM4KLK36NQ>
.
|
I made some minor tweaks (see comments above), good to go now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh thanks, I was going to address the rest comments tomorrow :P.
All looks good to me except the logic behind skipping protected in the entry searcher. See my inline comments. Basically, pre-filtering the protected terms is still necessary and I think your initial comment of putting it in parsing should work. I just didn't get time to sit down and actually look at it. Will do it tomorrow.
c284009
to
dc5b097
Compare
dc5b097
to
e30233e
Compare
Rebased and squashed the fixups into the original commit. |
It's |
19609a5
to
a1f599c
Compare
Type of change
Description and Context
This adds proper unit tests to the secret service integration plugin. The tests cover most exposed API and some regression tests for previously fixed issues.
The first commit adds all test cases. The whole test is added as a GUI test because currently the plugin still depends on
DatabaseWidget
. Other changes included in this commit:DatabaseOpenDialog
insideDatabaseTabWidget
is changed from usingQScopedPointer
to settingQObject
parent. The lifetime ofDatabaseOpenDialog
is not affected, but it enables the testing code to access theDatabaseOpenDialog
via object hierarchy.LAUNCHER
to theadd_unit_test
macro. The calling site can specify a launcher program used to start the test binary. This is needed to usedbus-run-session
to run the dbus test.The following commits fix issues discovered by newly added tests. One notable change is the addition of
skipProtected
option to the entry searcher. The option is disabled by default, so the behavior remains the same as before. When enabled, search terms referring to password or protected attributes are filtered out before the searcher performs the match. And if there are no terms left after filtering, the default is changed to not match, so the search API via DBus won't return everything when passing only this kind of terms. This is a more general solution of #4008, which only considers passwords.Testing strategy
make test
CTest runner will automatically use
dbus-run-session
to runtestguifdosecrets
.Checklist:
-DWITH_ASAN=ON
. [REQUIRED]