YunoHost / package_check

Shell script which check package actions: install, remove, upgrade, backup, restore…
GNU General Public License v3.0
21 stars 25 forks source link

Allow overriding is_webapp parameter in tests.toml #149

Open Jakski opened 9 months ago

Jakski commented 9 months ago

package_check tries to grep for ^ynh_add_nginx_config in order to decide whether tests with URL should be launched at all. I put ynh_add_nginx_config invocation in scripts/_common.sh in order to reuse some code between install and upgrade as a functions. With this approach package_check attempts to install my application only with nourl scenario. That's not correct. The following change makes it possible to override is_webapp parameter during tests by setting webapp in tests.toml.

Note that invoking ynh_add_nginx_config conditionally like:

if [ "$something" = 1 ]; then
    ynh_add_nginx_config
fi

would also make package_check treat application as a non-webapp, even though that's not true.

Salamandar commented 9 months ago

IMHO this configuration would be better in the tests.toml :)

Jakski commented 9 months ago

I agree, but for now I've left auto-detection using grep in order to not break compatibility with already existing applications.

Salamandar commented 9 months ago

Ah oops, i misread, now I see you already did that :)

alexAubin commented 9 months ago

We could also just grep _common.sh in addition to install

TBH we tend to discourage to "factorize" this kind of stuff like the add_nginx call etc ... Yes it's not pretty but anyway current packaging is pretty much trash (though less worse than packaging v1) until we implement packaging v3 ... Until then it's better to stick to common practice to facilitate community maintenance of all apps even though it's tempting to factorize stuff...