-
Notifications
You must be signed in to change notification settings - Fork 209
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
Simplify OpenQA::WebAPI::Controller::Test #4968
base: master
Are you sure you want to change the base?
Conversation
tests fail with
|
} | ||
return $match; | ||
sub get_match_param ($self) { | ||
return unless my $match = $self->param('match'); |
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.
return unless my $match = $self->param('match'); | |
return undef unless my $match = $self->param('match'); |
We should always return something. If I'm reading it correctly undef
is what we want here.
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.
yes, and looking at the usage this is very important here because we use the method in list context
@@ -22,25 +22,16 @@ use constant DEPENDENCY_DEBUG_INFO => $ENV{OPENQA_DEPENDENCY_DEBUG_INFO}; | |||
|
|||
sub referer_check ($self) { | |||
return $self->reply->not_found if (!defined $self->param('testid')); | |||
my $referer = $self->req->headers->header('Referer') // ''; | |||
return 1 unless $referer; | |||
return undef unless my $referer = $self->req->headers->header('Referer') // ''; |
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.
This looks like it would always have returned 1. Maybe this is somehow causing the tests to fail?
} | ||
return $match; | ||
sub get_match_param ($self) { | ||
return unless my $match = $self->param('match'); |
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.
This would now also return early if the parameter contains 0
.
This pull request is now in conflicts. Could you fix it? 🙏 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
No description provided.