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

Go to discover tests directory after login #3357

Merged
merged 7 commits into from
Dec 9, 2024
Merged

Conversation

falconizmi
Copy link
Collaborator

@falconizmi falconizmi commented Nov 12, 2024

Pull Request Checklist

  • implement the feature
  • extend the test coverage
  • include a release note

@falconizmi falconizmi self-assigned this Nov 12, 2024
@falconizmi falconizmi added command | login The login command used to access the guest ci | full test Pull request is ready for the full test execution labels Nov 12, 2024
tmt/steps/__init__.py Outdated Show resolved Hide resolved
tmt/steps/__init__.py Outdated Show resolved Hide resolved
@falconizmi
Copy link
Collaborator Author

falconizmi commented Nov 12, 2024

Solves issue #803
for tmt try, if user run tmt try --login, it wont run any tests as its how login was implemented:
-l, --login Log into the guest only, do not run any
and he will be logged in to worktree path

So the user needs to run tmt run -tests NAME then, when he will be asked what to do next, choose login option and in that case, he will be logged in test path

@falconizmi falconizmi added this to the 1.39 milestone Nov 12, 2024
@falconizmi falconizmi force-pushed the iquwarah-tmt-login-test-dir branch from 3f62bd3 to 274bdb5 Compare November 13, 2024 09:39
@martinhoyer martinhoyer self-requested a review November 19, 2024 10:26
@falconizmi falconizmi force-pushed the iquwarah-tmt-login-test-dir branch from 274bdb5 to 5480a8c Compare November 20, 2024 09:58
@falconizmi
Copy link
Collaborator Author

falconizmi commented Nov 21, 2024

Okay, I have here some failures because the test path, that I expect, is /var/tmp/tmt/run-XXX/something/discover/default-0/, but instead when we have this test case:
plan

summary: Basic smoke test
execute:
    how: tmt
    script: tmt --help

and run it with this tmt command:
tmt run -a provision -h local --feeling-safe
and after the run take a look in the directory /var/tmp/tmt/run-XXX/something/discover/, there is no default-0/ directery.
And in the check, there is after that command tmt run -l login -c true, which will fail, because it executes the last run that doesnt have folder default-0/
(or at least that what I think now)

Fixed by commit: 8f946c9

@psss psss linked an issue Nov 21, 2024 that may be closed by this pull request
@psss psss modified the milestones: 1.39, 1.40 Nov 21, 2024
Copy link
Collaborator

@martinhoyer martinhoyer left a comment

Choose a reason for hiding this comment

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

I don't have much experience with tmt try code, but tried it and this /bin/true approach seems to work :)

@psss psss force-pushed the iquwarah-tmt-login-test-dir branch from 8f946c9 to b67e154 Compare December 9, 2024 10:02
Copy link
Collaborator

@psss psss left a comment

Choose a reason for hiding this comment

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

Thanks for implementing this. Looks good. I just think that we do not have to exercise the /bin/true check when there are no tests. Adjusted in b67e154. Please have a look if the change is ok. It would be also good to add at least a basic test coverage and mention this in release notes as this feature was requested by users and they should learn about this good news :-)

@falconizmi falconizmi force-pushed the iquwarah-tmt-login-test-dir branch from b67e154 to 18e98ea Compare December 9, 2024 11:29
@psss psss force-pushed the iquwarah-tmt-login-test-dir branch from 18e98ea to 38e5171 Compare December 9, 2024 13:19
@psss psss self-assigned this Dec 9, 2024
@psss psss added the status | ready for merge The only missing piece is to do the rebase the current 'main' and let the CI finish. label Dec 9, 2024
@psss psss merged commit 3afd8ae into main Dec 9, 2024
19 of 20 checks passed
@psss psss deleted the iquwarah-tmt-login-test-dir branch December 9, 2024 15:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci | full test Pull request is ready for the full test execution command | login The login command used to access the guest status | ready for merge The only missing piece is to do the rebase the current 'main' and let the CI finish.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enter the test directory after login to the guest
5 participants