"/packit test" does not trigger builds if there were none before
Pull request https://github.com/psss/tmt/pull/187 has been created by @FrNecas who is not a contributor of `tmt`, so tests were not scheduled. I manually asked packit to run tests using `/packit test` but tests [failed](https://console-testing-farm.apps.ci.centos.org/pipeline/2a8f5dfd-c28f-472b-ba32-4f849d963e1f) because the copr build has not been created.
diff --git a/packit_service/models.py b/packit_service/models.py
index fe3650fd..5f0789ad 100644
--- a/packit_service/models.py
+++ b/packit_service/models.py
@@ -186,6 +186,11 @@ class PullRequestModel(Base):
                 session.add(pr)
             return pr
 
+    def get_copr_builds(self):
+        return JobTriggerModel.get_or_create(
+            type=JobTriggerModelType.pull_request, trigger_id=self.id
+        ).copr_builds
+
     def __repr__(self):
         return f"PullRequestModel(id={self.pr_id}, project={self.project})"
 
diff --git a/packit_service/worker/jobs.py b/packit_service/worker/jobs.py
index cb59968c..495bff15 100644
--- a/packit_service/worker/jobs.py
+++ b/packit_service/worker/jobs.py
@@ -28,6 +28,7 @@ from typing import Optional, Dict, Union, Type, Set
 
 from packit.config import JobType, PackageConfig, JobConfig
 from packit_service.config import ServiceConfig
+from packit_service.models import PullRequestModel
 from packit_service.log_versions import log_job_versions
 from packit_service.service.events import (
     PullRequestCommentGithubEvent,
@@ -245,6 +246,13 @@ class SteveJobs:
                     "msg": f"{msg} does not contain a valid packit-service command."
                 },
             )
+
+        if packit_action == CommentAction.test and isinstance(
+            event.db_trigger, PullRequestModel
+        ):
+            if not event.db_trigger.get_copr_builds():
+                packit_action = CommentAction.build
+
         handler_kls: Type[CommentActionHandler] = MAP_COMMENT_ACTION_TO_HANDLER.get(
             packit_action, None
         )
diff --git a/tests_requre/database/test_models.py b/tests_requre/database/test_models.py
index 853d2bb7..acadca20 100644
--- a/tests_requre/database/test_models.py
+++ b/tests_requre/database/test_models.py
@@ -494,3 +494,11 @@ def test_get_installation_by_account(
 ):
     assert InstallationModel.get_by_account_login("teg").sender_login == "teg"
     assert InstallationModel.get_by_account_login("Pac23").sender_login == "Pac23"
+
+
+def test_pr_get_copr_builds(
+    clean_before_and_after, a_copr_build_for_pr, different_pr_model
+):
+    pr_model = a_copr_build_for_pr.job_trigger.get_trigger_object()
+    assert a_copr_build_for_pr in pr_model.get_copr_builds()
+    assert not different_pr_model.get_copr_builds()
['packit_service/models.py', 'tests_requre/database/test_models.py', 'packit_service/worker/jobs.py']