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

Add development service convenience runner "openqa-run" #5796

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

okurz
Copy link
Member

@okurz okurz commented Jul 29, 2024

No description provided.

@okurz okurz marked this pull request as draft July 29, 2024 12:38
Copy link

Great PR! Please pay attention to the following items before merging:

Files matching docs/*.asciidoc:

  • Consider generating documentation locally to verify it is rendered correctly using tools/generate-docs

This is an automatically generated QA checklist based on modified files.

Copy link
Contributor

@b10n1k b10n1k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks first of all, but just no. IMO this is incomplete and make it even more confusing. Sorry.

Copy link
Contributor

@Martchus Martchus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All in all I'd say: no
This is causing more confusion than it is helping.

tools/openqa-run Outdated
done

main() {
sudo -u geekotest OPENQA_BASEDIR="${OPENQA_BASEDIR}" "$@"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really don't like the idea of calling the Mojo app as geekotest.

This script intends to use a sub directory of the Git checkout as OPENQA_BASEDIR to it should invoke everything as the user this checkout was made by. That's probably just the current user and not geekotest:

Suggested change
sudo -u geekotest OPENQA_BASEDIR="${OPENQA_BASEDIR}" "$@"
"$@"

Note that if one just checks out the Git repo (for development, without having any packages installed) the user geekotest might not even exist.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is geekotest even used here? I always considered that a detail of the production setup on e.g. o3 and not something I generally have for development

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really don't like the idea of calling the Mojo app as geekotest.

This script intends to use a sub directory of the Git checkout as OPENQA_BASEDIR to it should invoke everything as the user this checkout was made by. That's probably just the current user and not geekotest:

Note that if one just checks out the Git repo (for development, without having any packages installed) the user geekotest might not even exist.

Yes, correct. But we need to provide a database with the according role. So should we also set the database connection to use an automatically started test database from t/test_postgresql?

Why is geekotest even used here? I always considered that a detail of the production setup on e.g. o3 and not something I generally have for development

no, geekotest is also the user used within the packaged version and hence also the user that would be used in the initial database setup which one might want to reuse when running from the development directory.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would not recommend to reuse the same database.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So do you recommend to use an automatically started test database from t/test_postgresql?

exit "$1"
}

OPENQA_BASEDIR="${OPENQA_BASEDIR:-"$(dirname "$0")/../t/data"}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure whether that's the best idea. I get the idea of reusing test fixtures. However, it is also a bit problematic as this might lead to accidental cluttering and changes in that directory. This might be annoying because those changes might show up in Git (and we cannot just ignore them because files in that directory are supposed to be under version control) and might also lead to failures when running unit tests (which might not be obvious to debug).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could create a temporary directory and use that.

base-dir set to the local working copy.

Example:
openqa-run openqa-webui-daemon
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This kind of usage is very annoying without auto completion. In my helper is worked around this via shortcuts.

The script doesn't seem to ensure that e.g. openqa-webui-daemon is actually in the PATH so I guess this example also won't lead to a great out-of-the-box experience even if copied verbatimly. (The example you added to the docs does make sense, though.)

Comment on lines +297 to +298
services with `OPENQA_BASEDIR` set to your local development environment with
the appropriate service account. For example to start the openQA GRU service
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I disagree. The service account this script chooses is not appropriate for local development. I recommend not to mix the production/packaged setup with the development environment.

This description also makes it not clear at all to what OPENQA_BASEDIR is actually set (because "your local development environment" is not clear in this context, apparently it means test files from the current working dir but also only if OPENQA_BASEDIR is not set anyway).

@okurz okurz force-pushed the feature/openqa-run branch from a59d7a1 to aa7729f Compare July 31, 2024 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants