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

Testing improvements #32

Open
3 of 5 tasks
pabloyoyoista opened this issue Mar 4, 2022 · 3 comments
Open
3 of 5 tasks

Testing improvements #32

pabloyoyoista opened this issue Mar 4, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@pabloyoyoista
Copy link
Collaborator

pabloyoyoista commented Mar 4, 2022

Since #31 there are some basics tests which should help with development. However, the test process and the code is certainly improvable. This issue aims to document the most obvious problems for future reference:

  • The tests wrap Glib tests into python unittests, just because it was the easiest to setup. This should be changed to just a python script that starts the dbus mock server, runs tests and stops it.
  • The simple DBusMock implementation is too simple with just an AddMethods call, which allows to do very little (for example, no error testing possible). This should be changed to independent functions which implement each of the DBus methods.
  • The tests only consider successful DBus calls, but never any errors.
  • gs_plugin_refine is not tested, and probably one of the most important ones for a well-looking application. For those tests, it might be a good idea to set external-appstream-urls to have some real-world apps downloaded.
  • It would be ideal to also test behavior of appstream::source-file during refine. See Refine fixes #35
@Cogitri
Copy link
Owner

Cogitri commented Mar 5, 2022

gs_plugin_refine is not tested, and probably one of the most important ones for a well-looking application. For those tests, it might be a good idea to set external-appstream-urls to have some real-world apps downloaded.

Yeah, but it's also the toughest one to test. We probably want test to not require an internet connection, if possible. And we have lots of side effects in that function too when AS decides to refine the package already.

@pabloyoyoista
Copy link
Collaborator Author

pabloyoyoista commented Mar 5, 2022

Yeah, but it's also the toughest one to test

Yes, definitely... Although being able to manually set the refine flags in the jobs helps.

We probably want test to not require an internet connection, if possible.

Well, I guess we can just fetch one of the Components files that appstream-generator produces, trim it to just have a couple of useful apps, and drop it in the repo. That would avoid using the external-appstream-urls

And we have lots of side effects in that function too when AS decides to refine the package already.

Maybe we have different approaches here or maybe I am misunderstanding it, but isn't this what we ideally want? The apk plugin can provide very little information about the apps (mostly installation status and version/updatable version). So in my mind, our refine should just take care of becoming the manager plugin for the apps created by AS and set installation status, version and the other little metadata we can provide. I managed to move forward one WIP branch taking care about this yesterday, so I just pushed to #35 if you want to assess if it fixes some of the side-effects you were thinking of.

@pabloyoyoista pabloyoyoista added the enhancement New feature or request label May 5, 2022
pabloyoyoista added a commit to pabloyoyoista/gnome-software-plugin-apk that referenced this issue Jun 2, 2022
This allows to run more code on method calls and do more complicated
stuff.

Helps Cogitri#32
pabloyoyoista added a commit that referenced this issue Sep 19, 2022
Using the template allows to run more code on method calls and
do more complicated logic.

Helps #32
pabloyoyoista added a commit that referenced this issue Oct 23, 2022
Using the template allows to run more code on method calls and
do more complicated logic.

Helps #32
@pabloyoyoista
Copy link
Collaborator Author

The refine is indeed now being tested through the other calls. No major regressions in a while.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants