#5365 Fix unit test errors
Merged a month ago by ngompa. Opened 2 months ago by wombelix.
wombelix/pagure fix_unit_test_errors  into  master

file modified
+8 -8
@@ -504,7 +504,7 @@ 

      request = _get_request(repo, requestid)

      _check_pull_request_access(request, assignee=True)

  

-     form = pagure.forms.RequestPullForm(csrf_enabled=False)

+     form = pagure.forms.RequestPullForm(meta={"csrf": False})

      if not form.validate_on_submit():

          raise pagure.exceptions.APIError(

              400, error_code=APIERROR.EINVALIDREQ, errors=form.errors
@@ -942,7 +942,7 @@ 

      _check_token(repo, project_token=False)

      request = _get_request(repo, requestid)

  

-     form = pagure.forms.AddPullRequestCommentForm(csrf_enabled=False)

+     form = pagure.forms.AddPullRequestCommentForm(meta={"csrf": False})

      if form.validate_on_submit():

          comment = form.comment.data

          commit = form.commit.data or None
@@ -1123,12 +1123,12 @@ 

      request = _get_request(repo, requestid)

  

      if "status" in get_request_data():

-         form = pagure.forms.AddPullRequestFlagForm(csrf_enabled=False)

+         form = pagure.forms.AddPullRequestFlagForm(meta={"csrf": False})

      else:

-         form = pagure.forms.AddPullRequestFlagFormV1(csrf_enabled=False)

+         form = pagure.forms.AddPullRequestFlagFormV1(meta={"csrf": False})

      if form.validate_on_submit():

          username = form.username.data

-         percent = form.percent.data.strip() or None

+         percent = form.percent.data.strip() if form.percent.data else None

          comment = form.comment.data.strip()

          url = form.url.data.strip()

          uid = form.uid.data.strip() if form.uid.data else None
@@ -1376,7 +1376,7 @@ 

      _check_token(repo)

      request = _get_request(repo, requestid)

  

-     form = pagure.forms.SubscribtionForm(csrf_enabled=False)

+     form = pagure.forms.SubscribtionForm(meta={"csrf": False})

      if form.validate_on_submit():

          status = is_true(form.status.data)

          try:
@@ -1549,7 +1549,7 @@ 

      _check_pull_request(repo_to)

      _check_token(repo_from, project_token=False)

  

-     form = pagure.forms.RequestPullForm(csrf_enabled=False)

+     form = pagure.forms.RequestPullForm(meta={"csrf": False})

      if not form.validate_on_submit():

          raise pagure.exceptions.APIError(

              400, error_code=APIERROR.EINVALIDREQ, errors=form.errors
@@ -1838,7 +1838,7 @@ 

      request = _get_request(repo, requestid)

      _check_pull_request_access(request, assignee=True)

  

-     form = pagure.forms.AssignIssueForm(csrf_enabled=False)

+     form = pagure.forms.AssignIssueForm(meta={"csrf": False})

      if form.validate_on_submit():

          assignee = form.assignee.data or None

          # Create our metadata comment object

file modified
+7 -7
@@ -168,7 +168,7 @@ 

      form = pagure.forms.IssueFormSimplied(

          priorities=repo.priorities,

          milestones=repo.milestones,

-         csrf_enabled=False,

+         meta={"csrf": False},

      )

      if form.validate_on_submit():

          title = form.title.data
@@ -663,7 +663,7 @@ 

      issue = _get_issue(repo, issue_id, issueuid=issue_uid)

      _check_private_issue_access(issue)

  

-     form = pagure.forms.IssueFormSimplied(csrf_enabled=False)

+     form = pagure.forms.IssueFormSimplied(meta={"csrf": False})

  

      if form.validate_on_submit():

          title = form.title.data.strip()
@@ -837,7 +837,7 @@ 

  

      status = pagure.lib.query.get_issue_statuses(flask.g.session)

      form = pagure.forms.StatusForm(

-         status=status, close_status=repo.close_status, csrf_enabled=False

+         status=status, close_status=repo.close_status, meta={"csrf": False}

      )

  

      close_status = None
@@ -951,7 +951,7 @@ 

      _check_ticket_access(issue, open_access=open_access)

  

      form = pagure.forms.MilestoneForm(

-         milestones=repo.milestones.keys(), csrf_enabled=False

+         milestones=repo.milestones.keys(), meta={"csrf": False}

      )

  

      if form.validate_on_submit():
@@ -1049,7 +1049,7 @@ 

      issue = _get_issue(repo, issueid)

      _check_private_issue_access(issue)

  

-     form = pagure.forms.CommentForm(csrf_enabled=False)

+     form = pagure.forms.CommentForm(meta={"csrf": False})

      if form.validate_on_submit():

          comment = form.comment.data

          try:
@@ -1138,7 +1138,7 @@ 

      open_access = repo.settings.get("open_metadata_access_to_all", False)

      _check_ticket_access(issue, assignee=True, open_access=open_access)

  

-     form = pagure.forms.AssignIssueForm(csrf_enabled=False)

+     form = pagure.forms.AssignIssueForm(meta={"csrf": False})

      if form.validate_on_submit():

          assignee = form.assignee.data or None

          # Create our metadata comment object
@@ -1236,7 +1236,7 @@ 

      issue = _get_issue(repo, issueid)

      _check_private_issue_access(issue)

  

-     form = pagure.forms.SubscribtionForm(csrf_enabled=False)

+     form = pagure.forms.SubscribtionForm(meta={"csrf": False})

      if form.validate_on_submit():

          status = is_true(form.status.data)

          try:

file modified
+1 -1
@@ -108,7 +108,7 @@ 

          else:

              dbobj = plugin.db_object()

  

-     form = plugin.form(obj=dbobj, csrf_enabled=False)

+     form = plugin.form(obj=dbobj, meta={"csrf": False})

      form.active.data = True

      for field in plugin.form_fields:

          fields.append(getattr(form, field))

file modified
+12 -8
@@ -205,7 +205,7 @@ 

      repo = _get_repo(repo, username, namespace)

      _check_token(repo, project_token=False)

  

-     form = pagure.forms.ApiAddIssueTagForm(csrf_enabled=False)

+     form = pagure.forms.ApiAddIssueTagForm(meta={"csrf": False})

      if form.validate_on_submit():

          tag_name = form.tag.data

          tag_description = form.tag_description.data
@@ -433,7 +433,7 @@ 

          flask.request.values.get("with_commits", False)

      )

  

-     form = pagure.forms.AddGitTagForm(csrf_enabled=False)

+     form = pagure.forms.AddGitTagForm(meta={"csrf": False})

      created = None

      if form.validate_on_submit():

          user_obj = pagure.lib.query.get_user(
@@ -1455,7 +1455,9 @@ 

      if user:

          namespaces.extend([grp for grp in user.groups])

  

-     form = pagure.forms.ProjectForm(namespaces=namespaces, csrf_enabled=False)

+     form = pagure.forms.ProjectForm(

+         namespaces=namespaces, meta={"csrf": False}

+     )

      if form.validate_on_submit():

          name = form.name.data

          description = form.description.data
@@ -1739,7 +1741,7 @@ 

      """

      output = {}

  

-     form = pagure.forms.ForkRepoForm(csrf_enabled=False)

+     form = pagure.forms.ForkRepoForm(meta={"csrf": False})

      if form.validate_on_submit():

          repo = form.repo.data

          username = form.username.data or None
@@ -2433,10 +2435,10 @@ 

      except ValueError:

          raise pagure.exceptions.APIError(404, error_code=APIERROR.ENOCOMMIT)

  

-     form = pagure.forms.AddPullRequestFlagForm(csrf_enabled=False)

+     form = pagure.forms.AddPullRequestFlagForm(meta={"csrf": False})

      if form.validate_on_submit():

          username = form.username.data

-         percent = form.percent.data.strip() or None

+         percent = form.percent.data.strip() if form.percent.data else None

          comment = form.comment.data.strip()

          url = form.url.data.strip()

          uid = form.uid.data.strip() if form.uid.data else None
@@ -2700,7 +2702,7 @@ 

      project = _get_repo(repo, username, namespace)

      _check_token(project, project_token=False)

  

-     form = pagure.forms.ModifyACLForm(csrf_enabled=False)

+     form = pagure.forms.ModifyACLForm(meta={"csrf": False})

      if form.validate_on_submit():

          acl = form.acl.data

          group = None
@@ -3189,7 +3191,9 @@ 

          )

  

      authorized_acls = pagure_config.get("USER_ACLS", [])

-     form = pagure.forms.NewTokenForm(csrf_enabled=False, sacls=authorized_acls)

+     form = pagure.forms.NewTokenForm(

+         meta={"csrf": False}, sacls=authorized_acls

+     )

      if form.validate_on_submit():

          acls = form.acls.data

          description = form.description.data

file modified
+10 -6
@@ -17,9 +17,13 @@ 

  import docutils

  import docutils.core

  import docutils.examples

- import jinja2

+ 

+ try:

+     from jinja2 import escape

+ except ImportError:

+     from markupsafe import escape

  import kitchen.text.converters as ktc

- import markupsafe

+ from markupsafe import Markup

  

  import pagure.lib.encoding_utils

  import pagure.lib.query
@@ -85,7 +89,7 @@ 

              source=rst, writer_name="html", settings_overrides=overrides

          )

      except Exception:

-         return "<pre>%s</pre>" % jinja2.escape(rst)

+         return "<pre>%s</pre>" % escape(rst)

  

      else:

  
@@ -93,7 +97,7 @@ 

  

          html_string = modify_html(html_string)

  

-         html_string = markupsafe.Markup(html_string)

+         html_string = Markup(html_string)

          return html_string

  

  
@@ -111,7 +115,7 @@ 

          safe = True

      elif not ext or (ext and ext in [".text", ".txt"]):

          safe = True

-         output = "<pre>%s</pre>" % jinja2.escape(output)

+         output = "<pre>%s</pre>" % escape(output)

      return output, safe

  

  
@@ -124,7 +128,7 @@ 

  

      api_docs = modify_html(api_docs)

  

-     api_docs = markupsafe.Markup(api_docs)

+     api_docs = Markup(api_docs)

      return api_docs

  

  

file modified
+12
@@ -19,6 +19,7 @@ 

  import warnings

  

  import flask

+ from flask.wrappers import Request

  import pygit2

  from six.moves.urllib.parse import urljoin

  from whitenoise import WhiteNoise
@@ -60,11 +61,22 @@ 

      pagure.lib.query.set_pagure_ci(pagure_config["PAGURE_CI_SERVICES"])

  

  

+ # Enforce behavior of 'get_json' to return json even if

+ # Content-Type application/json is missing as in werkzeug < v2.1.0

+ # https://github.com/pallets/flask/issues/4552#issuecomment-1109785314

+ class AnyJsonRequest(Request):

+     def on_json_loading_failed(self, e):

+         if e is not None:

+             return super().on_json_loading_failed(e)

+ 

+ 

  def create_app(config=None):

      """Create the flask application."""

      app = flask.Flask(__name__)

      app.config = pagure_config

  

+     app.request_class = AnyJsonRequest

+ 

      if config:

          app.config.update(config)

  

@@ -84,6 +84,7 @@ 

      return all(ord(c) < 128 and ord(c) > 0 for c in s)

  

  

+ # fmt: off

  if PYTHON3:

  

      def is_string(s):
@@ -116,6 +117,7 @@ 

  

  

  else:

+ # fmt: on

  

      def is_string(s):

          try:
@@ -472,7 +474,7 @@ 

          stdin=stdin,

          stdout=subprocess.PIPE,

          stderr=subprocess.PIPE,

-         **kw

+         **kw,

      )

      (out, err) = p.communicate(input)

      out = bytes_to_str(out, errors=errors)
@@ -2940,7 +2942,7 @@ 

          strict_utf8=True,

          email_max_line_length=500,

          max_subject_length=500,

-         **kw

+         **kw,

      ):

          super(FilterLinesEnvironmentMixin, self).__init__(**kw)

          self.__strict_utf8 = strict_utf8
@@ -3077,7 +3079,7 @@ 

          announce_recipients,

          revision_recipients,

          scancommitforcc,

-         **kw

+         **kw,

      ):

          super(StaticRecipientsEnvironmentMixin, self).__init__(**kw)

  
@@ -3172,7 +3174,7 @@ 

                  config, "commitlist", "mailinglist"

              ),

              scancommitforcc=config.get("scancommitforcc"),

-             **kw

+             **kw,

          )

  

      def _get_recipients(self, config, *names):
@@ -3207,7 +3209,7 @@ 

          ref_filter_excl_regex,

          ref_filter_do_send_regex,

          ref_filter_dont_send_regex,

-         **kw

+         **kw,

      ):

          super(StaticRefFilterEnvironmentMixin, self).__init__(**kw)

  
@@ -3294,7 +3296,7 @@ 

              ref_filter_dont_send_regex=self._get_regex(

                  config, "refFilterDontSendRegex"

              ),

-             **kw

+             **kw,

          )

  

  

file modified
+3 -3
@@ -43,9 +43,9 @@ 

          index=True,

      )

  

-     server = sa.Column(sa.Text, nullable=False)

-     port = sa.Column(sa.Text, nullable=False)

-     room = sa.Column(sa.Text, nullable=False)

+     server = sa.Column(sa.Text, nullable=False, default="")

+     port = sa.Column(sa.Text, nullable=False, default="")

+     room = sa.Column(sa.Text, nullable=False, default="")

      nick = sa.Column(sa.Text, nullable=True, default=None)

      nick_pass = sa.Column(sa.Text, nullable=True, default=None)

      active = sa.Column(sa.Boolean, nullable=False, default=False)

file modified
+1 -1
@@ -46,7 +46,7 @@ 

          index=True,

      )

  

-     mail_to = sa.Column(sa.Text, nullable=False)

+     mail_to = sa.Column(sa.Text, nullable=False, default="")

      active = sa.Column(sa.Boolean, nullable=False, default=False)

  

      project = relation(

@@ -42,7 +42,7 @@ 

          index=True,

      )

  

-     branches = sa.Column(sa.Text, nullable=False)

+     branches = sa.Column(sa.Text, nullable=False, default="")

  

      active = sa.Column(sa.Boolean, nullable=False, default=False)

  

file modified
+2 -2
@@ -49,8 +49,8 @@ 

      active = sa.Column(sa.Boolean, nullable=False, default=False)

  

      branches = sa.Column(sa.Text, nullable=True)

-     api_url = sa.Column(sa.Text, nullable=False)

-     api_token = sa.Column(sa.Text, nullable=False)

+     api_url = sa.Column(sa.Text, nullable=False, default="")

+     api_token = sa.Column(sa.Text, nullable=False, default="")

  

      project = relation(

          "Project",

file modified
+4 -4
@@ -226,7 +226,7 @@ 

  @internal_access_only

  def pull_request_add_comment():

      """Add a comment to a pull-request."""

-     pform = pagure.forms.ProjectCommentForm(csrf_enabled=False)

+     pform = pagure.forms.ProjectCommentForm(meta={"csrf": False})

      if not pform.validate_on_submit():

          flask.abort(400, description="Invalid request")

  
@@ -240,7 +240,7 @@ 

      if not request:

          flask.abort(404, description="Pull-request not found")

  

-     form = pagure.forms.AddPullRequestCommentForm(csrf_enabled=False)

+     form = pagure.forms.AddPullRequestCommentForm(meta={"csrf": False})

  

      if not form.validate_on_submit():

          flask.abort(400, description="Invalid request")
@@ -277,7 +277,7 @@ 

  @internal_access_only

  def ticket_add_comment():

      """Add a comment to an issue."""

-     pform = pagure.forms.ProjectCommentForm(csrf_enabled=False)

+     pform = pagure.forms.ProjectCommentForm(meta={"csrf": False})

      if not pform.validate_on_submit():

          flask.abort(400, description="Invalid request")

  
@@ -308,7 +308,7 @@ 

              "to view it",

          )

  

-     form = pagure.forms.CommentForm(csrf_enabled=False)

+     form = pagure.forms.CommentForm(meta={"csrf": False})

  

      if not form.validate_on_submit():

          flask.abort(400, description="Invalid request")

file modified
+1 -1
@@ -68,7 +68,7 @@ 

      if cchardet:

          return encodings

  

-     if ch_version[0] in ("3", "4"):

+     if ch_version[0] in ("3", "4", "5"):

          for prober in detector._charset_probers:

              if hasattr(prober, "probers"):

                  for prober in prober.probers:

file modified
+4 -4
@@ -1354,7 +1354,7 @@ 

          stdout=subprocess.PIPE,

          stderr=subprocess.PIPE,

          cwd=abspath,

-         **kw

+         **kw,

      )

      (out, err) = procs.communicate(input)

      retcode = procs.wait()
@@ -1386,7 +1386,7 @@ 

          input=input,

          keepends=keepends,

          error=error,

-         **kw

+         **kw,

      )

  

  
@@ -2439,7 +2439,7 @@ 

      return tags

  

  

- def new_git_tag(project, tagname, target, user, message=None, force=False):

+ def new_git_tag(project, tagname, target, user, message=str(), force=False):

      """Create a new git tag in the git repositorie of the specified project.

  

      :arg project: the project in which we want to create a git tag
@@ -2471,7 +2471,7 @@ 

          target,

          target_obj.type,

          pygit2.Signature(user.fullname, user.default_email),

-         message,

+         message if message else str(),

      )

  

      return tag

file modified
+1 -1
@@ -880,7 +880,7 @@ 

          pull_request,

          repotype,

          is_internal,

-         **info

+         **info,

      ):

          if is_internal:

              self.info("Internal push allowed")

file modified
+4 -1
@@ -152,7 +152,10 @@ 

  

  

  def arrow_ts(value):

-     return "%s" % arrow.get(value).timestamp

+     if hasattr(arrow, "timestamp"):

+         return "%s" % arrow.get(value).timestamp  # arrow < v1.0.0

+     else:

+         return "%s" % arrow.get(value).float_timestamp  # arrow >= v1.0.0

  

  

  class AccessLevels(BASE):

file modified
+5 -5
@@ -2806,7 +2806,7 @@ 

          projects = projects.filter(model.Project.namespace == namespace)

  

      query = session.query(model.Project).filter(

-         model.Project.id.in_(projects.subquery())

+         model.Project.id.in_(projects.as_scalar())

      )

  

      if sort == "latest":
@@ -5524,7 +5524,7 @@ 

              flask_request.endpoint,

              per_page=per_page,

              _external=True,

-             **request_args_wo_page

+             **request_args_wo_page,

          )

  

      prev_page = None
@@ -5534,7 +5534,7 @@ 

              flask_request.endpoint,

              per_page=per_page,

              _external=True,

-             **request_args_wo_page

+             **request_args_wo_page,

          )

  

      request_args_wo_page.update({key_page: 1})
@@ -5542,7 +5542,7 @@ 

          flask_request.endpoint,

          per_page=per_page,

          _external=True,

-         **request_args_wo_page

+         **request_args_wo_page,

      )

  

      request_args_wo_page.update({key_page: pages})
@@ -5550,7 +5550,7 @@ 

          flask_request.endpoint,

          per_page=per_page,

          _external=True,

-         **request_args_wo_page

+         **request_args_wo_page,

      )

  

      return {

file modified
+1 -1
@@ -932,7 +932,7 @@ 

          # for each files computes the different algorythm supported

          with open(os.path.join(folder, filename), "rb") as stream:

              while True:

-                 buf = stream.read(2 * 2 ** 10)

+                 buf = stream.read(2 * 2**10)  # fmt: skip

                  if buf:

                      for hasher in algos.values():

                          hasher.update(buf)

file modified
+1 -1
@@ -267,7 +267,7 @@ 

              "x-Extra-project_user": project.user if project.is_fork else "",

              "X-Extra-project_namespace": project.namespace,

          },

-         **streamargs

+         **streamargs,

      )

  

      # Strip out any headers that cause problems

file modified
+29 -9
@@ -556,9 +556,16 @@ 

  

      form = pagure.forms.RequestPullEditForm(branches=flask.g.branches)

      if form.validate_on_submit():

-         request.title = form.title.data.strip()

-         request.initial_comment = form.initial_comment.data.strip()

-         request.branch = form.branch_to.data.strip()

+         request.title = form.title.data.strip() if form.title.data else None

+         request.initial_comment = (

+             form.initial_comment.data.strip()

+             if form.initial_comment.data

+             else None

+         )

+         request.branch = (

+             form.branch_to.data.strip() if form.branch_to.data else None

+         )

+ 

          if flask.g.fas_user.username == request.user.username:

              request.allow_rebase = form.allow_rebase.data

          flask.g.session.add(request)
@@ -1721,7 +1728,11 @@ 

              if orig_commit:

                  orig_commit = orig_commit.oid.hex

  

-             initial_comment = form.initial_comment.data.strip() or None

+             initial_comment = (

+                 form.initial_comment.data.strip()

+                 if form.initial_comment.data

+                 else None

+             )

              commit_start = commit_stop = None

              if diff_commits:

                  commit_stop = diff_commits[0].oid.hex
@@ -1887,9 +1898,13 @@ 

              except Exception as err:

                  flask.abort(500, description=err)

  

-         branch_from = form.branch_from.data.strip()

-         branch_to = form.branch_to.data.strip()

-         remote_git = form.git_repo.data.strip()

+         branch_from = (

+             form.branch_from.data.strip() if form.branch_from.data else None

+         )

+         branch_to = (

+             form.branch_to.data.strip() if form.branch_to.data else None

+         )

+         remote_git = form.git_repo.data.strip() if form.git_repo.data else None

  

          repopath = pagure.utils.get_remote_repo_path(remote_git, branch_from)

          if not repopath:
@@ -1969,7 +1984,10 @@ 

                  user=flask.g.fas_user.username,

              )

  

-             if form.initial_comment.data.strip() != "":

+             if (

+                 form.initial_comment.data

+                 and form.initial_comment.data.strip() != ""

+             ):

                  pagure.lib.query.add_pull_request_comment(

                      flask.g.session,

                      request=request,
@@ -2027,7 +2045,9 @@ 

          except pygit2.GitError:

              branch_to = "master"

      else:

-         branch_to = form.branch_to.data.strip()

+         branch_to = (

+             form.branch_to.data.strip() if form.branch_to.data else None

+         )

  

      return flask.render_template(

          "remote_pull_request.html",

file modified
+14 -10
@@ -207,7 +207,7 @@ 

          # Check if the optional field is filled

          if form.assignee.data:

              assignee = form.assignee.data.strip()

-         new_status = form.status.data.strip() or None

+         new_status = form.status.data.strip() if form.status.data else None

          close_status = form.close_status.data or None

          if close_status not in repo.close_status:

              close_status = None
@@ -225,7 +225,11 @@ 

          new_milestone = None

          try:

              if repo.milestones:

-                 new_milestone = form.milestone.data.strip() or None

+                 new_milestone = (

+                     form.milestone.data.strip()

+                     if form.milestone.data

+                     else None

+                 )

          except AttributeError:

              pass

  
@@ -630,7 +634,7 @@ 

                  no_milestones=no_stone,

                  count=True,

                  status=status,

-                 **fields

+                 **fields,

              )

          else:

              if status.lower() in ["open", "true"]:
@@ -654,7 +658,7 @@ 

              order=order,

              order_key=order_key,

              status=status,

-             **fields

+             **fields,

          )

          issues_cnt = pagure.lib.query.search_issues(

              flask.g.session,
@@ -665,7 +669,7 @@ 

              no_milestones=no_stone,

              count=True,

              status=status_count,

-             **fields

+             **fields,

          )

          oth_issues_cnt = pagure.lib.query.search_issues(

              flask.g.session,
@@ -676,7 +680,7 @@ 

              no_milestones=no_stone,

              count=True,

              status=other_status_count,

-             **fields

+             **fields,

          )

      else:

          issues = pagure.lib.query.search_issues(
@@ -689,7 +693,7 @@ 

              custom_search=custom_search,

              order=order,

              order_key=order_key,

-             **fields

+             **fields,

          )

          issues_cnt = pagure.lib.query.search_issues(

              flask.g.session,
@@ -698,7 +702,7 @@ 

              search_pattern=search_pattern,

              custom_search=custom_search,

              count=True,

-             **fields

+             **fields,

          )

          oth_issues_cnt = pagure.lib.query.search_issues(

              flask.g.session,
@@ -709,7 +713,7 @@ 

              no_milestones=no_stone,

              count=True,

              status="Open",

-             **fields

+             **fields,

          )

      tag_list = pagure.lib.query.get_tags_of_project(flask.g.session, repo)

  
@@ -741,7 +745,7 @@ 

          total_open=total_open,

          total_closed=total_closed,

          no_milestones=no_stone,

-         **fields

+         **fields,

      )

  

  

file modified
+4 -2
@@ -2374,7 +2374,9 @@ 

              pagure.lib.query.add_token_to_user(

                  flask.g.session,

                  repo,

-                 description=form.description.data.strip() or None,

+                 description=form.description.data.strip()

+                 if form.description.data

+                 else None,

                  acls=form.acls.data,

                  username=flask.g.fas_user.username,

                  expiration_date=form.expiration_date.data,
@@ -2596,7 +2598,7 @@ 

                  branch=branchname,

                  branchto=form.branch.data,

                  filename=filename,

-                 content=form.content.data,

+                 content=form.content.data if form.content.data else str(),

                  message="%s\n\n%s"

                  % (

                      form.commit_title.data.strip(),

file modified
+1
@@ -1,5 +1,6 @@ 

  [tool.black]

  line-length = 79

+ target-version = ['py39']

  include = '\.py?$'

  exclude = '''

  /(

file modified
+2 -2
@@ -1,2 +1,2 @@ 

- cryptography

- python-jenkins

+ cryptography <= 36.0.0

+ python-jenkins <= 1.7.0

file modified
+1 -1
@@ -1,1 +1,1 @@ 

- trololio

+ trololio == 1.0

file modified
+21 -15
@@ -1,18 +1,24 @@ 

- bcrypt

- beautifulsoup4

- black

- cryptography

- eventlet

- fedmsg

- flake8

- flask-oidc

- mock

+ bcrypt <= 3.2.2

+ beautifulsoup4 <= 4.11.1

+ black <= 22.8.0

+ cryptography <= 36.0.0

+ eventlet <= 0.33.2

+ fedmsg <= 1.1.2

+ flake8 <= 4.0.1

+ 

+ # Important: Until https://github.com/puiterwijk/flask-oidc/pull/144 is merged and a new version of flask-oidc is released,

+ # it's necessary to ensure `itsdangerous` is pinned to a version lower as 2.1 as well.

+ flask-oidc <= 1.4.0

+ itsdangerous < 2.1          

+ 

+ mock <= 4.0.3

  pagure-messages >= 0.0.1

- pytest

- pytest-cov

- pytest-xdist

- python-fedora

- trololio

+ pytest <= 6.2.5

+ pytest-cov <= 4.0.0

+ pytest-xdist <= 2.5.0

+ 

+ python-fedora == 1.1.1

+ trololio == 1.0

  

  # Seems that mock doesn't list this one

- funcsigs

+ funcsigs <= 1.0.2

file modified
+39 -31
@@ -1,42 +1,50 @@ 

  # Used for when working from a virtualenv.

  # Use this file by running "$ pip install -r requirements.txt"

- alembic

- arrow

- bcrypt

- binaryornot

- bleach

- blinker

- celery

- chardet

- cryptography

- docutils

+ alembic <= 1.8.1

+ arrow <= 1.2.3

+ bcrypt <= 3.2.2

+ binaryornot == 0.4.4

+ bleach <= 5.0.1

+ blinker <= 1.5

+ celery <= 5.2.6

+ chardet <= 4.0.0

+ cryptography <= 36.0.0

+ docutils <= 0.17.1

+ 

+ # required for backward compatibility

  email_validator

- flask

- flask-wtf

- kitchen

- markdown

- munch

- Pillow

- psutil

- pygit2 >= 0.26.0

- python3-openid

- python-openid-cla

- python-openid-teams

- redis

- requests

+ 

+ flask <= 2.2.2

+ flask-wtf <= 1.0.0

+ kitchen == 1.2.6

+ markdown <= 3.3.7

+ munch <= 2.5.0

+ Pillow <= 9.2.0

+ psutil <= 5.9.2

+ pygit2 >= 0.26.0, <=1.8.0

+ python3-openid <= 3.2.0

+ python-openid-cla == 1.2

+ python-openid-teams == 1.1

+ redis <= 3.5.3

+ requests <= 2.28.1

+ six <= 1.16.0

+ 

+ # required for backward compatibility

  setuptools

- six

- # sqlalchemy minimum 0.8

- sqlalchemy >= 0.8

- straight.plugin >= 1.5.0

- whitenoise

- wtforms

+ 

+ sqlalchemy >= 0.8, <=1.4.46

+ straight.plugin == 1.5.0

+ whitenoise <= 6.2.0

+ wtforms <= 3.0.1

  

  # Required only for the `oidc` authentication backend

- # flask-oidc

+ # Important: Until https://github.com/puiterwijk/flask-oidc/pull/144 is merged and a new version of flask-oidc is released, 

+ # it's necessary to ensure `itsdangerous` is pinned to a version lower as 2.1 as well.

+ # flask-oidc <= 1.4.0

+ # itsdangerous < 2.1

  

  # Required only if `USE_FLASK_SESSION_EXT` is set to `True`

  # flask-session

  

  # Required only for the `fas` and `openid` authentication backends

- # python-fedora

+ # python-fedora == 1.1.1

@@ -158,7 +158,9 @@ 

          )

  

      def test_api_board_create_no_data(self):

-         headers = {"Authorization": "token aaabbbcccddd"}

+         headers = {

+             "Authorization": "token aaabbbcccddd",

+         }

          data = {}

          output = self.app.post(

              "/api/0/test/boards", headers=headers, data=data
@@ -497,9 +499,6 @@ 

          }

  

          # Remove the board

-         headers = {

-             "Authorization": "token aaabbbcccddd",

-         }

          data = {}

          output = self.app.post(

              "/api/0/test/boards/delete", headers=headers, data=data

@@ -666,14 +666,14 @@ 

          )

          self.assertEqual(output.status_code, 400)

          data = json.loads(output.get_data(as_text=True))

-         self.assertDictEqual(

-             data,

-             {

-                 "error": "Invalid or incomplete input submitted",

-                 "error_code": "EINVALIDREQ",

-                 "errors": {"milestone": ["Not a valid choice"]},

-             },

-         )

+         expected_output = {

+             "error": "Invalid or incomplete input submitted",

+             "error_code": "EINVALIDREQ",

+             "errors": {"milestone": ["Not a valid choice"]},

+         }

+         if self.get_wtforms_version() >= (3, 0):

+             expected_output["errors"]["milestone"] = ["Not a valid choice."]

+         self.assertDictEqual(data, expected_output)

  

      def test_api_new_issue_milestone(self):

          """Test the api_new_issue method of the flask api."""
@@ -3154,14 +3154,14 @@ 

          )

          self.assertEqual(output.status_code, 400)

          data = json.loads(output.get_data(as_text=True))

-         self.assertDictEqual(

-             data,

-             {

-                 "error": "Invalid or incomplete input submitted",

-                 "error_code": "EINVALIDREQ",

-                 "errors": {"milestone": ["Not a valid choice"]},

-             },

-         )

+         expected_output = {

+             "error": "Invalid or incomplete input submitted",

+             "error_code": "EINVALIDREQ",

+             "errors": {"milestone": ["Not a valid choice"]},

+         }

+         if self.get_wtforms_version() >= (3, 0):

+             expected_output["errors"]["milestone"] = ["Not a valid choice."]

+         self.assertDictEqual(data, expected_output)

  

      @patch.dict(

          "pagure.config.config", {"FEDORA_MESSAGING_NOTIFICATIONS": True}

@@ -154,14 +154,14 @@ 

          )

          self.assertEqual(output.status_code, 400)

          data = json.loads(output.get_data(as_text=True))

-         self.assertDictEqual(

-             data,

-             {

-                 "error": "Invalid or incomplete input submitted",

-                 "error_code": "EINVALIDREQ",

-                 "errors": {"status": ["Not a valid choice"]},

-             },

-         )

+         expected_output = {

+             "error": "Invalid or incomplete input submitted",

+             "error_code": "EINVALIDREQ",

+             "errors": {"status": ["Not a valid choice"]},

+         }

+         if self.get_wtforms_version() >= (3, 0):

+             expected_output["errors"]["status"] = ["Not a valid choice."]

+         self.assertDictEqual(data, expected_output)

  

          # No change

          repo = pagure.lib.query.get_authorized_project(self.session, "test")

@@ -897,14 +897,14 @@ 

          )

          data = json.loads(output.get_data(as_text=True))

          self.assertEqual(output.status_code, 400)

-         self.assertDictEqual(

-             data,

-             {

-                 "error": "Invalid or incomplete input submitted",

-                 "error_code": "EINVALIDREQ",

-                 "errors": {"status": ["Not a valid choice"]},

-             },

-         )

+         expected_output = {

+             "error": "Invalid or incomplete input submitted",

+             "error_code": "EINVALIDREQ",

+             "errors": {"status": ["Not a valid choice"]},

+         }

+         if self.get_wtforms_version() >= (3, 0):

+             expected_output["errors"]["status"] = ["Not a valid choice."]

+         self.assertDictEqual(data, expected_output)

  

  

  class PagureFlaskApiPRFlagUserTokentests(tests.Modeltests):
@@ -1054,14 +1054,14 @@ 

          )

          self.assertEqual(output.status_code, 400)

          data = json.loads(output.get_data(as_text=True))

-         self.assertDictEqual(

-             data,

-             {

-                 "error": "Invalid or incomplete input submitted",

-                 "error_code": "EINVALIDREQ",

-                 "errors": {"status": ["Not a valid choice"]},

-             },

-         )

+         expected_output = {

+             "error": "Invalid or incomplete input submitted",

+             "error_code": "EINVALIDREQ",

+             "errors": {"status": ["Not a valid choice"]},

+         }

+         if self.get_wtforms_version() >= (3, 0):

+             expected_output["errors"]["status"] = ["Not a valid choice."]

+         self.assertDictEqual(data, expected_output)

  

          # No change

          self.session.commit()

@@ -2916,14 +2916,14 @@ 

          )

          self.assertEqual(output.status_code, 400)

          data = json.loads(output.get_data(as_text=True))

-         self.assertEqual(

-             data,

-             {

-                 "errors": {"status": ["Not a valid choice"]},

-                 "error_code": "EINVALIDREQ",

-                 "error": "Invalid or incomplete input submitted",

-             },

-         )

+         expected_output = {

+             "error": "Invalid or incomplete input submitted",

+             "error_code": "EINVALIDREQ",

+             "errors": {"status": ["Not a valid choice"]},

+         }

+         if self.get_wtforms_version() >= (3, 0):

+             expected_output["errors"]["status"] = ["Not a valid choice."]

+         self.assertDictEqual(data, expected_output)

  

      def test_flag_commit_with_uid(self):

          """Test flagging a commit with provided uid."""
@@ -3368,14 +3368,14 @@ 

          )

          self.assertEqual(output.status_code, 400)

          data = json.loads(output.get_data(as_text=True))

-         self.assertEqual(

-             data,

-             {

-                 "errors": {"status": ["Not a valid choice"]},

-                 "error_code": "EINVALIDREQ",

-                 "error": "Invalid or incomplete input submitted",

-             },

-         )

+         expected_output = {

+             "error": "Invalid or incomplete input submitted",

+             "error_code": "EINVALIDREQ",

+             "errors": {"status": ["Not a valid choice"]},

+         }

+         if self.get_wtforms_version() >= (3, 0):

+             expected_output["errors"]["status"] = ["Not a valid choice."]

+         self.assertDictEqual(data, expected_output)

  

      def test_commit_flags(self):

          """Test retrieving commit flags."""
@@ -3607,7 +3607,9 @@ 

              "error_code": "EINVALIDREQ",

              "errors": {"acl": ["Not a valid choice"]},

          }

-         self.assertEqual(data, expected_output)

+         if self.get_wtforms_version() >= (3, 0):

+             expected_output["errors"]["acl"] = ["Not a valid choice."]

+         self.assertDictEqual(data, expected_output)

  

      def test_api_modify_acls_user(self):

          """Test the api_modify_acls method of the flask api for
@@ -5664,14 +5666,14 @@ 

          output = self.app.post("/api/0/new/", data=data, headers=headers)

          self.assertEqual(output.status_code, 400)

          data = json.loads(output.get_data(as_text=True))

-         self.assertDictEqual(

-             data,

-             {

-                 "error": "Invalid or incomplete input submitted",

-                 "error_code": "EINVALIDREQ",

-                 "errors": {"namespace": ["Not a valid choice"]},

-             },

-         )

+         expected_output = {

+             "error": "Invalid or incomplete input submitted",

+             "error_code": "EINVALIDREQ",

+             "errors": {"namespace": ["Not a valid choice"]},

+         }

+         if self.get_wtforms_version() >= (3, 0):

+             expected_output["errors"]["namespace"] = ["Not a valid choice."]

+         self.assertDictEqual(data, expected_output)

  

          data = {

              "name": "test_42",

@@ -3239,14 +3239,14 @@ 

              )

              self.assertEqual(output.status_code, 400)

              data = json.loads(output.get_data(as_text=True))

-             self.assertDictEqual(

-                 data,

-                 {

-                     "error": "Invalid or incomplete input submitted",

-                     "error_code": "EINVALIDREQ",

-                     "errors": {"status": ["Not a valid choice"]},

-                 },

-             )

+             expected_output = {

+                 "error": "Invalid or incomplete input submitted",

+                 "error_code": "EINVALIDREQ",

+                 "errors": {"status": ["Not a valid choice"]},

+             }

+             if self.get_wtforms_version() >= (3, 0):

+                 expected_output["errors"]["status"] = ["Not a valid choice."]

+             self.assertDictEqual(data, expected_output)

  

              # No change

              repo = pagure.lib.query._get_project(self.session, "test4")

@@ -372,13 +372,13 @@ 

          # previous versions parsed it

          output = self.app.get("/api/0/user/pingou/activity/2016asd")

          arrow_version = self.get_arrow_version()

-         if arrow_version >= (0, 15, 6):

+         if arrow_version >= (1, 0, 0):

              self.assertEqual(output.status_code, 400)

              exp = {

                  "error": "Could not match input '2016asd' to any of the following formats: "

                  "YYYY-MM-DD, YYYY-M-DD, YYYY-M-D, YYYY/MM/DD, YYYY/M/DD, YYYY/M/D, "

                  "YYYY.MM.DD, YYYY.M.DD, YYYY.M.D, YYYYMMDD, YYYY-DDDD, YYYYDDDD, "

-                 "YYYY-MM, YYYY/MM, YYYY.MM, YYYY, W",

+                 "YYYY-MM, YYYY/MM, YYYY.MM, YYYY, W.",

                  "error_code": "ENOCODE",

              }

              self.assertEqual(json.loads(output.get_data(as_text=True)), exp)
@@ -388,7 +388,7 @@ 

                  "error": "Could not match input '2016asd' to any of the following formats: "

                  "YYYY-MM-DD, YYYY-M-DD, YYYY-M-D, YYYY/MM/DD, YYYY/M/DD, YYYY/M/D, "

                  "YYYY.MM.DD, YYYY.M.DD, YYYY.M.D, YYYYMMDD, YYYY-DDDD, YYYYDDDD, "

-                 "YYYY-MM, YYYY/MM, YYYY.MM, YYYY",

+                 "YYYY-MM, YYYY/MM, YYYY.MM, YYYY, W",

                  "error_code": "ENOCODE",

              }

              self.assertEqual(json.loads(output.get_data(as_text=True)), exp)

@@ -68,9 +68,14 @@ 

              data = form.csrf_token.current_token

  

              # CSRF token expired

-             if hasattr(flask_wtf, "__version__") and tuple(

-                 [int(v) for v in flask_wtf.__version__.split(".")]

-             ) < (0, 10, 0):

+             if hasattr(flask_wtf, "__version__"):

+                 flask_wtf_version = tuple(

+                     [int(v) for v in flask_wtf.__version__.split(".")]

+                 )

+             if flask_wtf_version and (

+                 flask_wtf_version < (0, 10, 0)

+                 or flask_wtf_version >= (0, 14, 0)

+             ):

                  expires = time.time() - 1

              else:

                  expires = (

@@ -6382,7 +6382,9 @@ 

              self.assertIn(

                  "<p>fork/foo/test is not part of fork/ralph/test2's "

                  "family</p>",

-                 output.get_data(as_text=True).replace("&#x27;", "'"),

+                 output.get_data(as_text=True)

+                 .replace("&#x27;", "'")

+                 .replace("&#39;", "'"),

              )

  

      @patch("pagure.lib.notify.send_email")

@@ -24,7 +24,7 @@ 

  class PagureFlaskPluginIRCtests(tests.SimplePagureTest):

      """Tests for pagure_hook plugin of pagure"""

  

-     def test_plugin_mail(self):

+     def test_plugin_irc(self):

          """Test the irc plugin on/off endpoint."""

  

          tests.create_projects(self.session)

@@ -223,14 +223,29 @@ 

              )

              self.assertNotIn("Hook Pagure CI activated", output_text)

  

-             if self.get_wtforms_version() >= (2, 2):

+             if self.get_wtforms_version() >= (3, 0):

                  self.assertIn(

                      '<div class="col-sm-10">\n        '

-                     '<input class="form-control pl-0" id="ci_url" name="ci_url" '

+                     '<input class="form-control pl-0" id="ci_url" maxlength="255" name="ci_url" '

+                     'required type="text" value="">\n    </div>\n  </div>\n      '

+                     '<div class="alert alert-danger">This field is required.</div',

+                     output_text,

+                 )

+                 self.assertIn(

+                     '<div class="col-sm-10">\n        '

+                     '<input class="form-control pl-0" id="ci_job" maxlength="255" name="ci_job" '

                      'required type="text" value="">\n    </div>\n  </div>\n      '

                      '<div class="alert alert-danger">This field is required.</div>',

                      output_text,

                  )

+             elif self.get_wtforms_version() >= (2, 2):

+                 self.assertIn(

+                     '<div class="col-sm-10">\n        '

+                     '<input class="form-control pl-0" id="ci_url" name="ci_url" '

+                     'required type="text" value="">\n    </div>\n  </div>\n      '

+                     '<div class="alert alert-danger">This field is required.</div',

+                     output_text,

+                 )

                  self.assertIn(

                      '<div class="col-sm-10">\n        '

                      '<input class="form-control pl-0" id="ci_job" name="ci_job" '

@@ -20,6 +20,7 @@ 

  import unittest

  

  import pygit2

+ import werkzeug

  import wtforms

  from mock import patch, MagicMock

  from bs4 import BeautifulSoup
@@ -173,9 +174,21 @@ 

          # Try creating a remote PR

          output = self.app.get("/test/diff/remote")

          self.assertEqual(output.status_code, 302)

-         self.assertIn(

+         expected_response = (

              "You should be redirected automatically to target URL: "

-             '<a href="/login/?',

+             '<a href="/login/?'

+         )

+         if hasattr(werkzeug, "__version__"):

+             werkzeug_v = tuple(

+                 int(el) for el in werkzeug.__version__.split(".")

+             )

+             if werkzeug_v >= (2, 1, 2):

+                 expected_response = (

+                     "You should be redirected automatically to the target URL: "

+                     '<a href="/login/?'

+                 )

+         self.assertIn(

+             expected_response,

              output.get_data(as_text=True),

          )

  

@@ -113,7 +113,6 @@ 

              self.assertEqual(output.status_code, 200)

              output_text = output.get_data(as_text=True)

              self.assertIn(

-                 "Remote hook declined the push: "

                  "Denied push for ref &#39;refs/heads/master&#39; for user &#39;pingou&#39;",

                  output_text,

              )
@@ -156,7 +155,6 @@ 

              self.assertEqual(output.status_code, 200)

              output_text = output.get_data(as_text=True)

              self.assertIn(

-                 "Remote hook declined the push: "

                  "Denied push for ref &#39;refs/heads/master&#39; for user &#39;pingou&#39;",

                  output_text,

              )

file modified
+2
@@ -102,6 +102,8 @@ 

              "--diff",

              "--exclude",

              '"/(.eggs|.git|.hg|.mypy_cache|.nox|.tox|.venv|_build|buck-out|build|dist)/"',

+             "--target-version",

+             "py39",

              REPO_PATH,

              TESTS_PATH,

          ]

file modified
+5 -10
@@ -1,21 +1,16 @@ 

  [tox]

- envlist = py{35,36,37,38,39}

+ envlist = py{37,38,39}

  skipsdist = True

  # If the user is missing an interpreter, don't fail

  skip_missing_interpreters = True

  

- 

  [testenv]

- usedevelop = True

  deps =

-     -rrequirements-testing.txt

+     wheel

+     -rrequirements.txt

      -rrequirements-ev.txt

-     python-openid

-     python-openid-teams

-     python-openid-cla

-     pytest-xdist

-     pytest-cov

-     pytest

+     -rrequirements-ci.txt

+     -rrequirements-testing.txt

  install_command =

      pip install {opts} {packages}

  setenv =

The unit tests causing a lot of trouble right now and producing a lot of errors, most of the time unrelated to the actual change.
This PR tries to get to a state where we can again rely on them and focus on bug fixes and improvements.

Work in Progress, errors reduced from 41 to 10 in local test environment, which is already running on Python 3.10 in F36 containers. It might break other things and will take further time to fully complete the PR.

3 new commits added

  • style: flake8 and black findings corrected
  • test(lib_git_auth): warnings changed output
  • test(ui_plugins_pagure_ci): returned html changed
2 months ago

In local tests down to seven failed:

========================================================================================================================== short test summary info ===========================================================================================================================
FAILED tests/test_pagure_flask_ui_plugins_irc.py::PagureFlaskPluginIRCtests::test_plugin_mail - TypeError: not all arguments converted during string formatting
FAILED tests/test_pagure_flask_ui_plugins_mail.py::PagureFlaskPluginMailtests::test_plugin_mail - TypeError: not all arguments converted during string formatting
FAILED tests/test_pagure_flask_ui_plugins_noff.py::PagureFlaskPluginNoFFtests::test_plugin_noff - TypeError: not all arguments converted during string formatting
FAILED tests/test_pagure_flask_ui_plugins_rtd_hook.py::PagureFlaskPluginRtdHooktests::test_plugin_pagure_request - TypeError: not all arguments converted during string formatting
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_delete_repo - AssertionError: '<span>\n              <i class="fa fa-calendar-o fa-rotate-270 fa-fw text-muted"></i>\n              <span class="d-none d-md-inline">Projects&nbsp;</span>\n         ...
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_delete_repo_when_turned_off - AssertionError: '<span class="btn btn-outline-secondary disabled opacity-100 border-0 ml-auto font-weight-bold">3 Projects</span>' not found in '\n<!DOCTYPE html>\n<ht...
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_edit_file - AssertionError: '<title>Commits - test - Pagure</title>' not found in '\n<!DOCTYPE html>\n<html lang=\'en\'>\n<head>\n    <meta http-equiv="Content-Type" content="text/html; charset=UTF...
=================================================================================================== 7 failed, 1697 passed, 7 skipped, 4410 warnings in 1929.65s (0:32:09) ====================================================================================================

1 new commit added

  • tests: wtforms changed error messages
2 months ago

rebased onto 3b31307

2 months ago

rebased onto b50f6ce

2 months ago

Recent push hopefully finally fixes AssertionError: {'err[58 chars]: 'EINVALIDREQ', 'errors': {'status': ['Not a valid choice']}}, let's wait for the CI run, local tests with f34 and f36 rpm container went fine.

OK still somehow around with packages used in F34 and with F36 other tests failing, but it's getting better, someday at least the tests with rpm packages will be fine again ;)

F36 RPM - local
========================================================================================================================== short test summary info ===========================================================================================================================
FAILED tests/test_pagure_flask_ui_plugins_irc.py::PagureFlaskPluginIRCtests::test_plugin_mail - TypeError: not all arguments converted during string formatting
FAILED tests/test_pagure_flask_ui_plugins_mail.py::PagureFlaskPluginMailtests::test_plugin_mail - TypeError: not all arguments converted during string formatting
FAILED tests/test_pagure_flask_ui_plugins_noff.py::PagureFlaskPluginNoFFtests::test_plugin_noff - TypeError: not all arguments converted during string formatting
FAILED tests/test_pagure_flask_ui_plugins_rtd_hook.py::PagureFlaskPluginRtdHooktests::test_plugin_pagure_request - TypeError: not all arguments converted during string formatting
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_delete_repo - AssertionError: '<span>\n              <i class="fa fa-calendar-o fa-rotate-270 fa-fw text-muted"></i>\n              <span class="d-none d-md-inline">Projects&nbsp;</span>\n         ...
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_delete_repo_when_turned_off - AssertionError: '<span class="btn btn-outline-secondary disabled opacity-100 border-0 ml-auto font-weight-bold">3 Projects</span>' not found in '\n<!DOCTYPE html>\n<ht...
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_edit_file - AssertionError: '<title>Commits - test - Pagure</title>' not found in '\n<!DOCTYPE html>\n<html lang=\'en\'>\n<head>\n    <meta http-equiv="Content-Type" content="text/html; charset=UTF...
=================================================================================================== 7 failed, 1697 passed, 8 skipped, 4402 warnings in 2073.83s (0:34:33) ====================================================================================================

F34 RPM - local
========================================================================================================================== short test summary info ===========================================================================================================================
FAILED tests/test_pagure_flask_api_issue.py::PagureFlaskApiIssuetests::test_api_change_milestone_issue_invalid_milestone - AssertionError: {'err[61 chars]EINVALIDREQ', 'errors': {'milestone': ['Not a valid choice']}} != {'err[61 chars]EINVALIDREQ', 'errors': {'milest...
FAILED tests/test_pagure_flask_api_issue.py::PagureFlaskApiIssuetests::test_api_new_issue_invalid_milestone - AssertionError: {'err[61 chars]EINVALIDREQ', 'errors': {'milestone': ['Not a valid choice']}} != {'err[61 chars]EINVALIDREQ', 'errors': {'milestone': ['Not a...
FAILED tests/test_pagure_flask_api_project.py::PagureFlaskApiProjectModifyAclTests::test_api_modify_acls_invalid_acl - AssertionError: {'err[55 chars]de': 'EINVALIDREQ', 'errors': {'acl': ['Not a valid choice']}} != {'err[55 chars]de': 'EINVALIDREQ', 'errors': {'acl'...
FAILED tests/test_pagure_flask_api_project.py::PagureFlaskApiProjectCreateProjectTests::test_api_new_project_user_token - AssertionError: {'err[61 chars]EINVALIDREQ', 'errors': {'namespace': ['Not a valid choice']}} != {'err[61 chars]EINVALIDREQ', 'errors': {'namespa...
FAILED tests/test_pagure_flask_api_user.py::PagureFlaskApiUSertests::test_api_view_user_activity_date - AssertionError: {'err[200 chars] YYYY-MM, YYYY/MM, YYYY.MM, YYYY, W", 'error_code': 'ENOCODE'} != {'err[200 chars] YYYY-MM, YYYY/MM, YYYY.MM, YYYY, W.", 'error_cod...
FAILED tests/test_pagure_flask_ui_plugins_pagure_ci.py::PagureFlaskPluginPagureCItests::test_plugin_pagure_ci - AssertionError: '<div class="col-sm-10">\n        <input class="form-control pl-0" id="ci_url" maxlength="255" name="ci_url" required type="text" value="">...
FAILED tests/test_style.py::TestStyle::test_code_with_black - AssertionError: 1 != 0
=================================================================================================== 7 failed, 1697 passed, 8 skipped, 2047 warnings in 2594.45s (0:43:14) ====================================================================================================

F34 - Pagure CI
=========================== short test summary info ============================
FAILED tests/test_pagure_flask_api_issue.py::PagureFlaskApiIssuetests::test_api_change_milestone_issue_invalid_milestone
FAILED tests/test_pagure_flask_api_project.py::PagureFlaskApiProjectCreateProjectTests::test_api_new_project_user_token
FAILED tests/test_pagure_flask_api_project.py::PagureFlaskApiProjectModifyAclTests::test_api_modify_acls_invalid_acl
FAILED tests/test_pagure_flask_api_issue.py::PagureFlaskApiIssuetests::test_api_new_issue_invalid_milestone
FAILED tests/test_pagure_flask_api_user.py::PagureFlaskApiUSertests::test_api_view_user_activity_date
FAILED tests/test_pagure_flask_ui_plugins_pagure_ci.py::PagureFlaskPluginPagureCItests::test_plugin_pagure_ci
FAILED tests/test_style.py::TestStyle::test_code_with_black - AssertionError:...
===== 7 failed, 1698 passed, 7 skipped, 2051 warnings in 982.94s (0:16:22) =====

You should be able to easily resolve the style failures...

You should be able to easily resolve the style failures...

As I started I thought that too, until I realized that black will become a moving target depending on it's own and the used python version.

On F36 it will fail, on F34 and even locally on my openSUSE Tumbleweed system it's running fine for the same file, it's only a about an additional empty line:

--- /pagure/pagure/hooks/files/git_multimail_upstream.py        2023-01-16 16:22:19.047464 +0000
+++ /pagure/pagure/hooks/files/git_multimail_upstream.py        2023-01-16 16:22:30.216651 +0000
@@ -111,10 +111,11 @@
         out = f.buffer.readline()
         try:
             return out.decode(sys.getdefaultencoding())
         except UnicodeEncodeError:
             return out.decode(ENCODING)
+

 else:

     def is_string(s):
         try:

stderr: 
would reformat /pagure/pagure/hooks/files/git_multimail_upstream.py
Oh no! 💥 💔 💥1 file would be reformatted, 203 files would be left unchanged.

Especially by pinning the target version to py39 and aligning the style of different files accordingly, I got it so far under control, except the above example, black policies don't feel stable across different tool version.

1 new commit added

  • style: set 'black' target version = py39
2 months ago

let's hope https://pagure.io/fork/wombelix/pagure/c/e62fd08ffe010531d20ddae2255e3c31235c9257 brings us closer, local f34 and f36 rpm container finally stopped complaining about styles.

pretty please pagure-ci rebuild

2 months ago

13 new commits added

  • test(flask_api_user): return value changed format
  • style: set 'black' target version = py39
  • tests: wtforms changed error messages
  • style: flake8 and black findings corrected
  • test(lib_git_auth): warnings changed output
  • test(ui_plugins_pagure_ci): returned html changed
  • fix: flask-wtf csrf validation requires timestamp
  • fix: arrow 'timestamp' property removed in >=v1.0.0
  • fix: var 'message' = type 'str' in 'new_git_tag()'
  • test: minor typo in multiple asserts corrected
  • fix: flake8 and black unit test errors
  • fix: strip() without testing if var is not None
  • fix: flask-wtf parameter 'csrf_enabled' deprecated
2 months ago

let's hope https://pagure.io/fork/wombelix/pagure/c/e62fd08ffe010531d20ddae2255e3c31235c9257 brings us closer, local f34 and f36 rpm container finally stopped complaining about styles.

looks good, no style errors anymore, did a lot of other changes and rewrote some commits, on F34 rpm we should now almost there, let's wait for jenkins to finish.

1 new commit added

  • fix: 'int_timestamp' replaced with 'float_timestamp'
2 months ago

Results after last commit in local F34 container: 1704 passed, 8 skipped, 2055 warnings in 1942.92s (0:32:22). Waiting for Jenkins CI to finish.

1 new commit added

  • test(api_project): remove trailing dot from assert
2 months ago

f34 and centos8 rpm now passing without issues, f34 pip is failing, probably related to https://pagure.io/pagure/pull-request/5360

cherry picked https://pagure.io/pagure/pull-request/5360 on top of this one in my local working copy and let the f34 pip container running before and after. It shows that without fixing the jinja2 escape issue, there is no way to get the pip based tests back working, jinja2.escape isn't available anymore in the package installed via pip.

F34 pip py38 - without 56e7655 (fix: cannot import name 'escape' from 'jinja2') - https://pagure.io/pagure/pull-request/5360

============================================================================================================================ test session starts =============================================================================================================================
platform linux -- Python 3.8.16, pytest-7.2.1, pluggy-1.0.0
cachedir: /tox/py38/.pytest_cache
rootdir: /pagure
plugins: cov-4.0.0, xdist-3.1.0
gw0 [1692] / gw1 [1692] / gw2 [1692] / gw3 [1692]                                                                                                                                                                                                                            
.FFFFFFFFFFFF.FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF [ 15%]
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF [ 30%]
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF [ 46%]
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF [ 61%]
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF [ 77%]
FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF.FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF.FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF [ 92%]
FFFFFFFFFFFFFFFFFFF..FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFsssFFsFsFFFFFFFFsFF...F...F                                                                                                                                               [100%]Traceback (most recent call last):
  File "/tox/py38/bin/pytest", line 8, in <module>
    sys.exit(console_main())
  File "/tox/py38/lib/python3.8/site-packages/_pytest/config/__init__.py", line 190, in console_main
    code = main()
  File "/tox/py38/lib/python3.8/site-packages/_pytest/config/__init__.py", line 167, in main
    ret: Union[ExitCode, int] = config.hook.pytest_cmdline_main(
  File "/tox/py38/lib/python3.8/site-packages/pluggy/_hooks.py", line 265, in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
  File "/tox/py38/lib/python3.8/site-packages/pluggy/_manager.py", line 80, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "/tox/py38/lib/python3.8/site-packages/pluggy/_callers.py", line 60, in _multicall
    return outcome.get_result()
  File "/tox/py38/lib/python3.8/site-packages/pluggy/_result.py", line 60, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/tox/py38/lib/python3.8/site-packages/pluggy/_callers.py", line 39, in _multicall
    res = hook_impl.function(*args)
  File "/tox/py38/lib/python3.8/site-packages/_pytest/main.py", line 317, in pytest_cmdline_main
    return wrap_session(config, _main)
  File "/tox/py38/lib/python3.8/site-packages/_pytest/main.py", line 305, in wrap_session
    config.hook.pytest_sessionfinish(
  File "/tox/py38/lib/python3.8/site-packages/pluggy/_hooks.py", line 265, in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
  File "/tox/py38/lib/python3.8/site-packages/pluggy/_manager.py", line 80, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "/tox/py38/lib/python3.8/site-packages/pluggy/_callers.py", line 55, in _multicall
    gen.send(outcome)
  File "/tox/py38/lib/python3.8/site-packages/_pytest/terminal.py", line 808, in pytest_sessionfinish
    outcome.get_result()
  File "/tox/py38/lib/python3.8/site-packages/pluggy/_result.py", line 60, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/tox/py38/lib/python3.8/site-packages/pluggy/_callers.py", line 39, in _multicall
    res = hook_impl.function(*args)
  File "/tox/py38/lib/python3.8/site-packages/xdist/dsession.py", line 86, in pytest_sessionfinish
    nm.teardown_nodes()
  File "/tox/py38/lib/python3.8/site-packages/xdist/workermanage.py", line 81, in teardown_nodes
    self.group.terminate(self.EXIT_TIMEOUT)
  File "/tox/py38/lib/python3.8/site-packages/execnet/multi.py", line 215, in terminate
    safe_terminate(
  File "/tox/py38/lib/python3.8/site-packages/execnet/multi.py", line 308, in safe_terminate
    reply = workerpool.spawn(termkill, termfunc, killfunc)
  File "/tox/py38/lib/python3.8/site-packages/execnet/gateway_base.py", line 315, in spawn
    self.execmodel.start(self._perform_spawn, (reply,))
  File "/tox/py38/lib/python3.8/site-packages/execnet/gateway_base.py", line 93, in exec_start
    self._start_new_thread(func, args)
RuntimeError: can't start new thread
ERROR: InvocationError for command /tox/py38/bin/pytest -n auto tests (exited with code 1)
__________________________________________________________________________________________________________________________________ summary ___________________________________________________________________________________________________________________________________
ERROR:   py38: commands failed

F34 pip py38 - with 56e7655 (fix: cannot import name 'escape' from 'jinja2') - https://pagure.io/pagure/pull-request/5360

========================================================================================================================== short test summary info ===========================================================================================================================
FAILED tests/test_pagure_flask_api_boards.py::PagureFlaskApiBoardstests::test_api_board_create_no_contenttype - json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
FAILED tests/test_pagure_flask_api_boards.py::PagureFlaskApiBoardstests::test_api_board_create_no_data - json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
FAILED tests/test_pagure_flask_api_issue_custom_fields.py::PagureFlaskApiCustomFieldIssuetests::test_api_update_custom_field_bad_request - json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
FAILED tests/test_pagure_flask_api_boards.py::PagureFlaskApiBoardsWithBoardtests::test_api_board_delete_invalid_html_input - json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
FAILED tests/test_pagure_flask_api_pr_flag.py::PagureFlaskApiPRFlagtests::test_no_input - json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
FAILED tests/test_pagure_flask_api_fork.py::PagureFlaskApiForktests::test_api_pull_request_merge - AssertionError: 400 != 200
FAILED tests/test_pagure_flask_api_fork.py::PagureFlaskApiForktests::test_api_pull_request_merge_conflicting - AssertionError: 400 != 409
FAILED tests/test_pagure_flask_api_fork.py::PagureFlaskApiForktests::test_api_pull_request_merge_user_token - AssertionError: 400 != 200
FAILED tests/test_pagure_flask_api_pr_flag.py::PagureFlaskApiPRFlagUserTokentests::test_no_input - json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
FAILED tests/test_pagure_flask_api_project.py::PagureFlaskApiProjectOptionsTests::test_api_modify_project_options_no_data - AssertionError: 400 != 200
FAILED tests/test_pagure_flask_api_project.py::PagureFlaskApiProjecttests::test_api_modify_project_invalid_request - json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
FAILED tests/test_pagure_flask_ui_app.py::PagureFlaskApptests::test_markdown_preview_valid_commit - AssertionError: '<div class="markdown"><p>Cf commit <a hre[126 chars]div>' != 'Cf commit 13d2e3b0d74eb97c0719379d4dde60efa6308378'
FAILED tests/test_pagure_flask_api_issue.py::PagureFlaskApiIssuetests::test_api_update_custom_field - AssertionError: 400 != 200
FAILED tests/test_pagure_flask_ui_app.py::PagureFlaskApptests::test_new_project_with_template - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_flask_ui_app.py::PagureFlaskApptests::test_non_ascii_new_project - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_flask_ui_app.py::PagureFlaskApptests::test_patched_markdown_preview - AssertionError: '<div class="markdown"><p>pingou committed[174 chars]div>' != 'pingou committed on test#9364354a4555ba17[20 chars]aecd'
FAILED tests/test_pagure_flask_api_ui_private_repo.py::PagurePrivateRepotest::test_api_private_repo_pr_merge - AssertionError: 400 != 200
FAILED tests/test_pagure_flask_api_user.py::PagureFlaskApiUSertests::test_api_view_user_activity_date - AssertionError: {'act[60 chars]2', 'description_mk': 'pingou created PR test#[1030 chars]-17'} != {'act[60 chars]2', 'type': 'created', 'description_mk': '<div[1450 chars]-17'}
FAILED tests/test_pagure_flask_ui_app.py::PagureFlaskAppNewProjecttests::test_new_project_readme - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_flask_ui_fork.py::PagureFlaskForktests::test_fork_edit_file - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_flask_ui_app.py::PagureFlaskAppNewProjecttests::test_new_project_with_default_branch - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_flask_ui_fork.py::PagureFlaskForktests::test_fork_edit_file_namespace - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_flask_ui_app.py::PagureFlaskAppNewProjecttests::test_new_project_with_default_branch_instance_wide - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_flask_ui_app.py::PagureFlaskAppNewProjecttests::test_new_project_with_default_branch_instance_wide_overriden - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_flask_ui_issues.py::PagureFlaskIssuestests::test_view_issue_forked_namespace_comment - AssertionError: '<span class="comment_text comment_body"><div class="markdown"><p>foo bar <a href="/fork/pingou/ns/test3/issue/1" title="[Open] test issue">#1</a> see?</p></div></span>' not found in '\n<!DOCTYPE html>\n<html lang=\'en\'>\n<head>\n    <meta http-equ...
FAILED tests/test_pagure_flask_ui_issues.py::PagureFlaskIssuestests::test_view_issue_namespace_comment - AssertionError: '<span class="comment_text comment_body"><div class="markdown"><p>foo bar <a href="/ns/test3/issue/1" title="[Open] test issue">#1</a> see?</p></div></span>' not found in '\n<!DOCTYPE html>\n<html lang=\'en\'>\n<head>\n    <meta http-equiv="Content-...
FAILED tests/test_pagure_flask_docs.py::PagureFlaskDocstests::test_view_docs - AssertionError: 500 != 200
FAILED tests/test_pagure_flask_docs.py::PagureFlaskDocstests::test_view_docs_encoding_error - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_flask_ui_fork.py::PagureFlaskForktests::test_new_request_pull_fork_to_other_unrelated_fork - AssertionError: "<p>fork/foo/test is not part of fork/ralph/test2's family</p>" not found in '<!doctype html>\n<html lang=en>\n<title>400 Bad Request</title>\n<h1>Bad Request</h1>\n<p>fork/foo/test is not part of fork/ralph/test2&#39;s family</p>\n'
FAILED tests/test_pagure_flask_ui_fork.py::PagureFlaskForktests::test_new_request_pull_from_fork_fixing_ticket - AssertionError: '<p>Test Initial Comment</p>\n<p>Fixes <a href' not found in '\n<!DOCTYPE html>\n<html lang=\'en\'>\n<head>\n    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>\n    <title>PR#3: foo bar PR - test\n - Pagure</title>\n    <link r...
FAILED tests/test_pagure_flask_ui_issues_templates.py::PagureFlaskIssuesTemplatetests::test_get_ticket_template_w_template - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_flask_ui_issues_templates.py::PagureFlaskIssuesTemplatetests::test_get_ticket_template_w_template_namespace - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_flask_rebase.py::PagureRebasetests::test_rebase_api_api_logged_in - AssertionError: 400 != 200
FAILED tests/test_pagure_flask_ui_issues_templates.py::PagureFlaskIssuesTemplatetests::test_new_issue_w_specific_template - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_flask_ui_issues_templates.py::PagureFlaskIssuesTemplatetests::test_new_issue_w_template - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_flask_rebase.py::PagureRebasetests::test_rebase_api_conflicts - json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
FAILED tests/test_pagure_flask_rebase.py::PagureRebasetests::test_rebase_api_ui_logged_in_different_user - AssertionError: 400 != 200
FAILED tests/test_pagure_flask_ui_login.py::PagureFlaskLogintests::test_force_logout - werkzeug.exceptions.BadRequestKeyError: 400 Bad Request: The browser (or proxy) sent a request that this server could not understand.
FAILED tests/test_pagure_flask_rebase.py::PagureRebasetests::test_rebase_api_ui_logged_in_pull_request_author - AssertionError: 400 != 200
FAILED tests/test_pagure_flask_rebase.py::PagureRebaseNoHooktests::test_rebase_api_ui_logged_in - AssertionError: 400 != 200
FAILED tests/test_pagure_flask_rebase.py::PagureRebaseNotAllowedtests::test_rebase_api_api_logged_in - AssertionError: 400 != 200
FAILED tests/test_pagure_flask_rebase.py::PagureRebaseNotAllowedtests::test_rebase_api_ui_logged_in - AssertionError: 400 != 200
FAILED tests/test_pagure_flask_ui_no_master_branch.py::PagureFlaskNoMasterBranchtests::test_view_file - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_flask_ui_no_master_branch.py::PagureFlaskNoMasterBranchtests::test_view_raw_file - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_flask_rebase.py::PagureRebaseNotAllowedtests::test_rebase_api_ui_logged_in_different_user - AssertionError: 400 != 200
FAILED tests/test_pagure_flask_rebase.py::PagureRebaseNotAllowedtests::test_rebase_api_ui_logged_in_pull_request_author - AssertionError: 400 != 200
FAILED tests/test_pagure_flask_ui_remote_pr.py::PagureRemotePRtests::test_new_remote_pr_unauth - AssertionError: 'You should be redirected automatically to target URL: <a href="/login/?' not found in '<!doctype html>\n<html lang=en>\n<title>Redirecting...</title>\n<h1>Redirecting...</h1>\n<p>You should be redirected automatically to the target URL: <a href="/l...
FAILED tests/test_pagure_flask_ui_plugins_irc.py::PagureFlaskPluginIRCtests::test_plugin_mail - TypeError: not all arguments converted during string formatting
FAILED tests/test_pagure_flask_ui_plugins_mail.py::PagureFlaskPluginMailtests::test_plugin_mail - TypeError: not all arguments converted during string formatting
FAILED tests/test_pagure_flask_ui_plugins_noff.py::PagureFlaskPluginNoFFtests::test_plugin_noff - TypeError: not all arguments converted during string formatting
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_view_file - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_view_file_with_wrong_encoding - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_view_raw_file - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_view_repo - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_delete_repo - AssertionError: '<span>\n              <i class="fa fa-calendar-o fa-rotate-270 fa-fw text-muted"></i>\n              <span class="d-none d-md-inline">Projects&nbsp;</span>\n            </span>\n            <div class="ml-auto">\n              <span class="badge ba...
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_view_tree - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_flask_ui_plugins_rtd_hook.py::PagureFlaskPluginRtdHooktests::test_plugin_pagure_request - TypeError: not all arguments converted during string formatting
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_delete_repo_when_turned_off - AssertionError: '<span class="btn btn-outline-secondary disabled opacity-100 border-0 ml-auto font-weight-bold">3 Projects</span>' not found in '\n<!DOCTYPE html>\n<html lang=\'en\'>\n<head>\n    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>\...
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_edit_file - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_flask_ui_repo_view_blame.py::PagureFlaskRepoViewBlameFiletests::test_view_blame_file_default_branch_master - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_flask_ui_repo_view_blame.py::PagureFlaskRepoViewBlameFiletests::test_view_blame_file_default_branch_non_master - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_flask_ui_repo_view_blame.py::PagureFlaskRepoViewBlameFiletests::test_view_blame_file_non_ascii_name - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_flask_ui_repo_view_blame.py::PagureFlaskRepoViewBlameFiletests::test_view_blame_file_on_branch - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_flask_ui_repo_view_blame.py::PagureFlaskRepoViewBlameFiletests::test_view_blame_file_on_commit - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_flask_ui_repo_view_blame.py::PagureFlaskRepoViewBlameFiletests::test_view_blame_file_on_tag - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_flask_ui_repo_view_file.py::PagureFlaskRepoViewFiletests::test_view_file_basic_text - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_flask_ui_slash_branch_name.py::PagureFlaskSlashInBranchtests::test_view_file - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_flask_ui_slash_branch_name.py::PagureFlaskSlashInBranchtests::test_view_raw_file - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_flask_ui_repo_view_file.py::PagureFlaskRepoViewFiletests::test_view_file_empty_file - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_flask_ui_repo_view_file.py::PagureFlaskRepoViewFiletests::test_view_file_fork_and_edit_logged_in - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_flask_ui_repo_view_file.py::PagureFlaskRepoViewFiletests::test_view_file_fork_and_edit_logged_out - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_flask_ui_repo_view_file.py::PagureFlaskRepoViewFiletests::test_view_file_nested_file - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_flask_ui_repo_view_file.py::PagureFlaskRepoViewFiletests::test_view_file_non_ascii_file - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_flask_ui_repo_view_file.py::PagureFlaskRepoViewFileForktests::test_view_file_fork_and_edit_on_a_fork - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_flask_ui_repo_view_file.py::PagureFlaskRepoViewFileForktests::test_view_file_fork_and_edit_on_fork_logged_out - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_flask_ui_repo_view_file.py::PagureFlaskRepoViewFileForktests::test_view_file_fork_and_edit_on_project - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_flask_ui_repo_view_file.py::PagureFlaskRepoViewFileForktests::test_view_file_fork_and_edit_on_your_fork - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_flask_ui_repo_view_file.py::PagureFlaskRepoViewFileForktests::test_view_file_in_branch_in_fork - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_flask_ui_repo_view_file.py::PagureFlaskRepoViewFileForktests::test_view_file_nested_file_in_fork - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_lib.py::PagureLibtests::test_text2markdown - AssertionError: 'foo bar test#1 see?' != '<div class="markdown"><p>foo bar <a href=[77 chars]div>'
FAILED tests/test_pagure_lib.py::PagureLibtests::test_text2markdown_table - AssertionError: '<div[40 chars]\n<th>Left-aligned</th>\n<th>Center-aligned</t[236 chars]div>' != '<div[40 chars]\n<th align="left">Left-aligned</th>\n<th alig[362 chars]div>'
FAILED tests/test_pagure_lib.py::PagureLibtests::test_text2markdown_table_old_mk - AssertionError: '<div[40 chars]\n<th>Left-aligned</th>\n<th>Center-aligned</t[236 chars]div>' != '<div[40 chars]\n<th align="left">Left-aligned</th>\n<th alig[362 chars]div>'
FAILED tests/test_pagure_lib_encoding_utils.py::TestGuessEncodings::test_guess_encodings - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_lib_encoding_utils.py::TestDecode::test_decode - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_lib_encoding_utils.py::TestGuessEncoding::test_guess_encoding_ascii - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_lib_encoding_utils.py::TestGuessEncoding::test_guess_encoding_favor_utf_8 - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_lib_git_auth.py::PagureLibGitAuthtests::test_edit_pr - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_lib_git.py::PagureLibGitCommitToPatchtests::test_commit_to_patch_empty_commit - AssertionError: 'From c5f88c4ef97f75d4445ae5864c06e0e70087[137 chars]\n\n' != ''
FAILED tests/test_pagure_lib_git_auth.py::PagureLibGitAuthtests::test_edit_with_all_allowed - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_lib_git_auth.py::PagureLibGitAuthtests::test_edit_with_all_denied - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_lib_git_auth.py::PagureLibGitAuthPagureBackendtests::test_edit_commit_passed_epel8 - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_lib_git_auth.py::PagureLibGitAuthPagureBackendtests::test_edit_contributor_passed_epel - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_lib_git_auth.py::PagureLibGitAuthPagureBackendtests::test_edit_contributor_passed_epel8 - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_lib_git_auth.py::PagureLibGitAuthPagureBackendtests::test_edit_contributor_passed_epel_no_regex - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_lib_git_auth.py::PagureLibGitAuthPagureBackendtests::test_edit_contributor_rejected - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_lib_mimetype.py::TestMIMEType::test_get_normal_headers - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_lib_mimetype.py::TestMIMEType::test_guess_type - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_flask_ui_issues.py::PagureFlaskIssuestests::test_new_issue_customized - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_lib_git_auth.py::PagureLibGitAuthPagureBackendtests::test_edit_no_commit - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_lib_git_auth.py::PagureLibGitAuthPagureBackendtests::test_edit_ticket_rejected - AttributeError: 'UniversalDetector' object has no attribute '_mCharSetProbers'
FAILED tests/test_pagure_merge_pr_no_fork.py::PagureMergePrNoForkTest::test_api_pull_request_merge - AssertionError: 400 != 200
FAILED tests/test_pagure_flask_ui_issues.py::PagureFlaskIssuestests::test_update_issue - AssertionError: '<span class="font-size-09 autogenerated-comment pl-4"><div class="markdown"><p><strong>Metadata Update from <a href="http://localhost.localdomain/user/pingou"></a><a href="http://localhost.localdomain/user/pingou">@pingou</a></strong>:<br>\n- Issue...
FAILED tests/test_pagure_merge_pr_no_fork.py::PagureMergePrNoForkTest::test_api_pull_request_merge_no_fork - AssertionError: 400 != 200
FAILED tests/test_pfmarkdown.py::TestObjAnchorTag::test_obj_anchor_tag_issue - AttributeError: module 'markdown.util' has no attribute 'etree'
FAILED tests/test_pfmarkdown.py::TestObjAnchorTag::test_obj_anchor_tag_private_issue - AttributeError: module 'markdown.util' has no attribute 'etree'
FAILED tests/test_pfmarkdown.py::TestObjAnchorTag::test_obj_anchor_tag_pr - AttributeError: module 'markdown.util' has no attribute 'etree'
FAILED tests/test_pagure_flask_ui_issues.py::PagureFlaskIssuestests::test_update_issue_add_tags - AssertionError: '<br>\n- Issue tagged with: green, red</p>' not found in '\n<!DOCTYPE html>\n<html lang=\'en\'>\n<head>\n    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>\n    <title>Issue #1: Test issue - test - Pagure</title>\n    <link rel...
ERROR tests/test_pagure_flask_ui_oidc_login.py
============================================================================================== 107 failed, 1593 passed, 8 skipped, 1119 warnings, 1 error in 2055.39s (0:34:15) ==============================================================================================

so you want me to merge that one so you can try to continue fixing this one?

so you want me to merge that one so you can try to continue fixing this one?

Either you merge https://pagure.io/pagure/pull-request/5360 or I can close it and put the change also in this PR together with all the other unit test fiex. I know this PR becomes quite large already, not sure if you happy with that. But i thought keeping it all together until the unit tests finally go back to green is probably the best.

rebased onto b0e8051

2 months ago

I merged that one now and this now has conflicts with master.

Or I guess it successfully rebased, nevermind?

Or I guess it successfully rebased, nevermind?

I didn't pushed it, just did the cherry picking and testing locally, so we are good, thanks a lot for merging the other one :thumbsup:

For documentation purposes, f34 rpm and centos stream 8 rpm still passing with the jinja2.escape > markupsafe.escape switch. So I only have to fix 107 failed tests in the pip environment and we are back in business :D

F34 rpm - with 56e7655643ccbc3079fab7af010ea99bfa71a884 (fix: cannot import name 'escape' from 'jinja2') - https://pagure.io/pagure/pull-request/5360
============================================================================================================================ test session starts =============================================================================================================================
platform linux -- Python 3.9.13, pytest-6.2.2, py-1.11.0, pluggy-0.13.1
rootdir: /pagure
plugins: forked-1.3.0, xdist-2.2.0
gw0 [1711] / gw1 [1711] / gw2 [1711] / gw3 [1711]                                                                                                                                                                                                                            
...................................................................................................................................................................................................................................................................... [ 15%]
...................................................................................................................................................................................................................................................................... [ 30%]
...................................................................................................................................................................................................................................................................... [ 45%]
....s................................................................................................................................................................................................................................................................. [ 61%]
...................................................................................................................................................................................................................................................................... [ 76%]
...................................................................................................................................................................................................................................................................... [ 91%]
.................................................................................................................ss....s..s...s.........s..                                                                                                                            [100%]
======================================================================================================== 1704 passed, 8 skipped, 2055 warnings in 2030.96s (0:33:50) =========================================================================================================


Centos 8 Stream rpm - with 56e7655643ccbc3079fab7af010ea99bfa71a884 (fix: cannot import name 'escape' from 'jinja2') - https://pagure.io/pagure/pull-request/5360
============================================================================================================================ test session starts =============================================================================================================================
platform linux -- Python 3.6.8, pytest-3.4.2, py-1.5.3, pluggy-0.6.0
rootdir: /pagure, inifile:
plugins: xdist-1.24.1, forked-1.0.2, celery-4.3.0
gw0 [1711] / gw1 [1711] / gw2 [1711] / gw3 [1711] / gw4 [1711] / gw5 [1711] / gw6 [1711] / gw7 [1711]
scheduling tests via LoadScheduling
...................................................................................................................................................................................................................................................................... [ 15%]
...................................................................................................................................................................................................................................................................... [ 30%]
...................................................................................................................................................................................................................................................................... [ 45%]
...................................................................................................................................................................................................................................................................... [ 61%]
....................................................................................................................................s................................................................................................................................. [ 76%]
...................................................................................................................................................................................................................................................................... [ 91%]
.........................................................................................................ss.........s.s..s...s.......s.....                                                                                                                            [100%]
=========================================================================================================== 1703 passed, 8 skipped, 4 warnings in 1004.78 seconds ============================================================================================================

rebased onto f7db3a0

2 months ago

f34 and centos8 stream rpm passing, f34 pip py38 completed without RuntimeError: can't start new thread error and down from 107 to 51 (local) / 53 (jenkins ci) failed tests.

17 new commits added

  • fix: invalid json request > error 400 html response
  • fix: 'UniversalDetector' no attr '_mCharSetProbers'
  • test(api_project): remove trailing dot from assert
  • fix: 'int_timestamp' replaced with 'float_timestamp'
  • test(flask_api_user): return value changed format
  • style: set 'black' target version = py39
  • tests: wtforms changed error messages
  • style: flake8 and black findings corrected
  • test(lib_git_auth): warnings changed output
  • test(ui_plugins_pagure_ci): returned html changed
  • fix: flask-wtf csrf validation requires timestamp
  • fix: arrow 'timestamp' property removed in >=v1.0.0
  • fix: var 'message' = type 'str' in 'new_git_tag()'
  • test: minor typo in multiple asserts corrected
  • fix: flake8 and black unit test errors
  • fix: strip() without testing if var is not None
  • fix: flask-wtf parameter 'csrf_enabled' deprecated
2 months ago

f34 and centos8 stream rpm passing, f34 pip py38 down to 29 failed and 1 error.

3 new commits added

  • build(requirements): pin python package versions
  • build(requirements): remove 'setuptools'
  • build(requirements): remove 'email_validator'
2 months ago

18 new commits added

  • build(requirements): pin python package versions
  • fix: invalid json request > error 400 html response
  • fix: 'UniversalDetector' no attr '_mCharSetProbers'
  • test(api_project): remove trailing dot from assert
  • fix: 'int_timestamp' replaced with 'float_timestamp'
  • test(flask_api_user): return value changed format
  • style: set 'black' target version = py39
  • tests: wtforms changed error messages
  • style: flake8 and black findings corrected
  • test(lib_git_auth): warnings changed output
  • test(ui_plugins_pagure_ci): returned html changed
  • fix: flask-wtf csrf validation requires timestamp
  • fix: arrow 'timestamp' property removed in >=v1.0.0
  • fix: var 'message' = type 'str' in 'new_git_tag()'
  • test: minor typo in multiple asserts corrected
  • fix: flake8 and black unit test errors
  • fix: strip() without testing if var is not None
  • fix: flask-wtf parameter 'csrf_enabled' deprecated
2 months ago

Build 111 (Jan 18, 2023, 7:33:51 PM)

F34 rpm: 1705 passed, 7 skipped, 2059 warnings
C8S rpm: 1703 passed, 8 skipped, 4 warnings
F34 pip: 10 failed, 1690 passed, 8 skipped, 1458 warnings, 1 error

1 new commit added

  • build(tox): align used pkgs, remove py35 and py36
2 months ago

Status Update, some slightly different results between jenkins ci and my local container, but overall good progress. F34 and C8S RPM are stable, F34 PIP shows some errors but there are very similar to the errors I see in F36 RPM and F36 PIP. I hope to find some time during the next days to get the rest fixed.

2023-01-19 Baseline
-------------------

Jenkins CI
**********

F34 rpm:
========== 1705 passed, 7 skipped, 2059 warnings in 992.18s (0:16:32) ==========

C8S rpm:
============= 1703 passed, 8 skipped, 4 warnings in 819.18 seconds =============

F34 pip:
=========================== short test summary info ============================
FAILED tests/test_pagure_flask_ui_plugins_irc.py::PagureFlaskPluginIRCtests::test_plugin_mail
FAILED tests/test_pagure_flask_ui_plugins_mail.py::PagureFlaskPluginMailtests::test_plugin_mail
FAILED tests/test_pagure_flask_ui_plugins_noff.py::PagureFlaskPluginNoFFtests::test_plugin_noff
FAILED tests/test_pagure_flask_ui_remote_pr.py::PagureRemotePRtests::test_new_remote_pr_unauth
FAILED tests/test_pagure_flask_ui_plugins_rtd_hook.py::PagureFlaskPluginRtdHooktests::test_plugin_pagure_request
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_edit_file
FAILED tests/test_pagure_flask_docs.py::PagureFlaskDocstests::test_view_docs
FAILED tests/test_pagure_flask_ui_fork.py::PagureFlaskForktests::test_new_request_pull_fork_to_other_unrelated_fork
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_delete_repo
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_delete_repo_when_turned_off
ERROR tests/test_pagure_flask_ui_oidc_login.py
= 10 failed, 1690 passed, 8 skipped, 1458 warnings, 1 error in 970.78s (0:16:10) =


Local Container
***************

CentOS Stream 8 RPM:
1703 passed, 8 skipped, 4 warnings

Fedora 34 RPM:
1704 passed, 8 skipped, 2055 warnings

Fedora 34 PIP:
========================================================================================================================== short test summary info ===========================================================================================================================
FAILED tests/test_pagure_flask_docs.py::PagureFlaskDocstests::test_view_docs - AssertionError: 500 != 200
FAILED tests/test_pagure_flask_ui_fork.py::PagureFlaskForktests::test_new_request_pull_fork_to_other_unrelated_fork - AssertionError: "<p>fork/foo/test is not part of fork/ralph/test2's family</p>" not found in '<!doctype html>\n<html lang=en>\n<title>400 Bad Request...
FAILED tests/test_pagure_flask_ui_plugins_irc.py::PagureFlaskPluginIRCtests::test_plugin_mail - TypeError: not all arguments converted during string formatting
FAILED tests/test_pagure_flask_ui_plugins_mail.py::PagureFlaskPluginMailtests::test_plugin_mail - TypeError: not all arguments converted during string formatting
FAILED tests/test_pagure_flask_ui_plugins_noff.py::PagureFlaskPluginNoFFtests::test_plugin_noff - TypeError: not all arguments converted during string formatting
FAILED tests/test_pagure_flask_ui_plugins_rtd_hook.py::PagureFlaskPluginRtdHooktests::test_plugin_pagure_request - TypeError: not all arguments converted during string formatting
FAILED tests/test_pagure_flask_ui_remote_pr.py::PagureRemotePRtests::test_new_remote_pr_unauth - AssertionError: 'You should be redirected automatically to target URL: <a href="/login/?' not found in '<!doctype html>\n<html lang=en>\n<title>Redirecting...</title>\n<h...
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_delete_repo - AssertionError: '<span>\n              <i class="fa fa-calendar-o fa-rotate-270 fa-fw text-muted"></i>\n              <span class="d-none d-md-inline">Projects&nbsp;</span>\n         ...
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_delete_repo_when_turned_off - AssertionError: '<span class="btn btn-outline-secondary disabled opacity-100 border-0 ml-auto font-weight-bold">3 Projects</span>' not found in '\n<!DOCTYPE html>\n<ht...
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_edit_file - AssertionError: '<title>Commits - test - Pagure</title>' not found in '\n<!DOCTYPE html>\n<html lang=\'en\'>\n<head>\n    <meta http-equiv="Content-Type" content="text/html; charset=UTF...
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_renew_api_token - AssertionError: datetime.date(2023, 7, 17) != datetime.date(2023, 7, 18)
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_revoke_api_token - AssertionError: datetime.date(2023, 7, 17) != datetime.date(2023, 7, 18)
ERROR tests/test_pagure_flask_ui_oidc_login.py
============================================================================================== 12 failed, 1688 passed, 8 skipped, 1398 warnings, 1 error in 1881.39s (0:31:21) ===============================================================================================

Fedora 36 RPM:
========================================================================================================================== short test summary info ===========================================================================================================================
FAILED tests/test_pagure_flask_ui_plugins_irc.py::PagureFlaskPluginIRCtests::test_plugin_mail - TypeError: not all arguments converted during string formatting
FAILED tests/test_pagure_flask_ui_plugins_mail.py::PagureFlaskPluginMailtests::test_plugin_mail - TypeError: not all arguments converted during string formatting
FAILED tests/test_pagure_flask_ui_plugins_noff.py::PagureFlaskPluginNoFFtests::test_plugin_noff - TypeError: not all arguments converted during string formatting
FAILED tests/test_pagure_flask_ui_plugins_rtd_hook.py::PagureFlaskPluginRtdHooktests::test_plugin_pagure_request - TypeError: not all arguments converted during string formatting
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_delete_repo - AssertionError: '<span>\n              <i class="fa fa-calendar-o fa-rotate-270 fa-fw text-muted"></i>\n              <span class="d-none d-md-inline">Projects&nbsp;</span>\n         ...
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_delete_repo_when_turned_off - AssertionError: '<span class="btn btn-outline-secondary disabled opacity-100 border-0 ml-auto font-weight-bold">3 Projects</span>' not found in '\n<!DOCTYPE html>\n<ht...
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_edit_file - AssertionError: '<title>Commits - test - Pagure</title>' not found in '\n<!DOCTYPE html>\n<html lang=\'en\'>\n<head>\n    <meta http-equiv="Content-Type" content="text/html; charset=UTF...
=================================================================================================== 7 failed, 1697 passed, 8 skipped, 4406 warnings in 1884.92s (0:31:24) ====================================================================================================

Fedora 36 PIP:
========================================================================================================================== short test summary info ===========================================================================================================================
FAILED tests/test_pagure_flask_docs.py::PagureFlaskDocstests::test_view_docs - AssertionError: 500 != 200
FAILED tests/test_pagure_flask_ui_fork.py::PagureFlaskForktests::test_new_request_pull_fork_to_other_unrelated_fork - AssertionError: "<p>fork/foo/test is not part of fork/ralph/test2's family</p>" not found in '<!doctype html>\n<html lang=en>\n<title>400 Bad Request...
FAILED tests/test_pagure_flask_ui_plugins_irc.py::PagureFlaskPluginIRCtests::test_plugin_mail - TypeError: not all arguments converted during string formatting
FAILED tests/test_pagure_flask_ui_plugins_mail.py::PagureFlaskPluginMailtests::test_plugin_mail - TypeError: not all arguments converted during string formatting
FAILED tests/test_pagure_flask_ui_plugins_noff.py::PagureFlaskPluginNoFFtests::test_plugin_noff - TypeError: not all arguments converted during string formatting
FAILED tests/test_pagure_flask_ui_plugins_rtd_hook.py::PagureFlaskPluginRtdHooktests::test_plugin_pagure_request - TypeError: not all arguments converted during string formatting
FAILED tests/test_pagure_flask_ui_remote_pr.py::PagureRemotePRtests::test_new_remote_pr_unauth - AssertionError: 'You should be redirected automatically to target URL: <a href="/login/?' not found in '<!doctype html>\n<html lang=en>\n<title>Redirecting...</title>\n<h...
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_delete_repo - AssertionError: '<span>\n              <i class="fa fa-calendar-o fa-rotate-270 fa-fw text-muted"></i>\n              <span class="d-none d-md-inline">Projects&nbsp;</span>\n         ...
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_delete_repo_when_turned_off - AssertionError: '<span class="btn btn-outline-secondary disabled opacity-100 border-0 ml-auto font-weight-bold">3 Projects</span>' not found in '\n<!DOCTYPE html>\n<ht...
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_edit_file - AssertionError: '<title>Commits - test - Pagure</title>' not found in '\n<!DOCTYPE html>\n<html lang=\'en\'>\n<head>\n    <meta http-equiv="Content-Type" content="text/html; charset=UTF...
ERROR tests/test_pagure_flask_ui_oidc_login.py
============================================================================================== 10 failed, 1690 passed, 8 skipped, 1405 warnings, 1 error in 1869.53s (0:31:09) ===============================================================================================

rebased onto b7ab1b4

2 months ago

rebased onto f7db3a0

2 months ago

rebased onto 34faff4

2 months ago

After setting version limits in requirements.txt, the jenkins ci and local pip based container and tests finally come up with identical results. Also F36 behave now very similar to F34, overall down to 8 failed tests that need to be fixed.

Jenkins CI
**********

F34 rpm: 1705 passed, 7 skipped, 2059 warnings

C8S rpm: 1703 passed, 8 skipped, 4 warnings

F34 pip: 8 failed, 1696 passed, 8 skipped, 1467 warnings
FAILED tests/test_pagure_flask_ui_plugins_irc.py::PagureFlaskPluginIRCtests::test_plugin_mail
FAILED tests/test_pagure_flask_ui_plugins_mail.py::PagureFlaskPluginMailtests::test_plugin_mail
FAILED tests/test_pagure_flask_ui_plugins_noff.py::PagureFlaskPluginNoFFtests::test_plugin_noff
FAILED tests/test_pagure_flask_ui_plugins_rtd_hook.py::PagureFlaskPluginRtdHooktests::test_plugin_pagure_request
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_edit_file
FAILED tests/test_pagure_flask_ui_fork.py::PagureFlaskForktests::test_new_request_pull_fork_to_other_unrelated_fork
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_delete_repo
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_delete_repo_when_turned_off


Local Container
***************

CentOS Stream 8 RPM: 1703 passed, 8 skipped, 4 warnings

Fedora 34 RPM: 1704 passed, 8 skipped, 2055 warnings

Fedora 34 PIP: 8 failed, 1696 passed, 8 skipped, 1411 warnings
FAILED tests/test_pagure_flask_ui_fork.py::PagureFlaskForktests::test_new_request_pull_fork_to_other_unrelated_fork - AssertionError: "<p>fork/foo/test is not part of fork/ralph/test2's family</p>" not found in '<!doctype html>\n<html lang=en>\n<title>400 Bad Request...
FAILED tests/test_pagure_flask_ui_plugins_irc.py::PagureFlaskPluginIRCtests::test_plugin_mail - TypeError: not all arguments converted during string formatting
FAILED tests/test_pagure_flask_ui_plugins_mail.py::PagureFlaskPluginMailtests::test_plugin_mail - TypeError: not all arguments converted during string formatting
FAILED tests/test_pagure_flask_ui_plugins_noff.py::PagureFlaskPluginNoFFtests::test_plugin_noff - TypeError: not all arguments converted during string formatting
FAILED tests/test_pagure_flask_ui_plugins_rtd_hook.py::PagureFlaskPluginRtdHooktests::test_plugin_pagure_request - TypeError: not all arguments converted during string formatting
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_delete_repo - AssertionError: '<span>\n              <i class="fa fa-calendar-o fa-rotate-270 fa-fw text-muted"></i>\n              <span class="d-none d-md-inline">Projects&nbsp;</span>\n         ...
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_delete_repo_when_turned_off - AssertionError: '<span class="btn btn-outline-secondary disabled opacity-100 border-0 ml-auto font-weight-bold">3 Projects</span>' not found in '\n<!DOCTYPE html>\n<ht...
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_edit_file - AssertionError: '<title>Commits - test - Pagure</title>' not found in '\n<!DOCTYPE html>\n<html lang=\'en\'>\n<head>\n    <meta http-equiv="Content-Type" content="text/html; charset=UTF...

Fedora 36 RPM: 7 failed, 1697 passed, 8 skipped, 4410 warnings
FAILED tests/test_pagure_flask_ui_plugins_irc.py::PagureFlaskPluginIRCtests::test_plugin_mail - TypeError: not all arguments converted during string formatting
FAILED tests/test_pagure_flask_ui_plugins_mail.py::PagureFlaskPluginMailtests::test_plugin_mail - TypeError: not all arguments converted during string formatting
FAILED tests/test_pagure_flask_ui_plugins_noff.py::PagureFlaskPluginNoFFtests::test_plugin_noff - TypeError: not all arguments converted during string formatting
FAILED tests/test_pagure_flask_ui_plugins_rtd_hook.py::PagureFlaskPluginRtdHooktests::test_plugin_pagure_request - TypeError: not all arguments converted during string formatting
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_delete_repo - AssertionError: '<span>\n              <i class="fa fa-calendar-o fa-rotate-270 fa-fw text-muted"></i>\n              <span class="d-none d-md-inline">Projects&nbsp;</span>\n         ...
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_delete_repo_when_turned_off - AssertionError: '<span class="btn btn-outline-secondary disabled opacity-100 border-0 ml-auto font-weight-bold">3 Projects</span>' not found in '\n<!DOCTYPE html>\n<ht...
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_edit_file - AssertionError: '<title>Commits - test - Pagure</title>' not found in '\n<!DOCTYPE html>\n<html lang=\'en\'>\n<head>\n    <meta http-equiv="Content-Type" content="text/html; charset=UTF...

Fedora 36 PIP: 8 failed, 1696 passed, 8 skipped, 1411 warnings
FAILED tests/test_pagure_flask_ui_fork.py::PagureFlaskForktests::test_new_request_pull_fork_to_other_unrelated_fork - AssertionError: "<p>fork/foo/test is not part of fork/ralph/test2's family</p>" not found in '<!doctype html>\n<html lang=en>\n<title>400 Bad Request...
FAILED tests/test_pagure_flask_ui_plugins_irc.py::PagureFlaskPluginIRCtests::test_plugin_mail - TypeError: not all arguments converted during string formatting
FAILED tests/test_pagure_flask_ui_plugins_mail.py::PagureFlaskPluginMailtests::test_plugin_mail - TypeError: not all arguments converted during string formatting
FAILED tests/test_pagure_flask_ui_plugins_noff.py::PagureFlaskPluginNoFFtests::test_plugin_noff - TypeError: not all arguments converted during string formatting
FAILED tests/test_pagure_flask_ui_plugins_rtd_hook.py::PagureFlaskPluginRtdHooktests::test_plugin_pagure_request - TypeError: not all arguments converted during string formatting
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_delete_repo - AssertionError: '<span>\n              <i class="fa fa-calendar-o fa-rotate-270 fa-fw text-muted"></i>\n              <span class="d-none d-md-inline">Projects&nbsp;</span>\n         ...
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_delete_repo_when_turned_off - AssertionError: '<span class="btn btn-outline-secondary disabled opacity-100 border-0 ml-auto font-weight-bold">3 Projects</span>' not found in '\n<!DOCTYPE html>\n<ht...
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_edit_file - AssertionError: '<title>Commits - test - Pagure</title>' not found in '\n<!DOCTYPE html>\n<html lang=\'en\'>\n<head>\n    <meta http-equiv="Content-Type" content="text/html; charset=UTF...

2 new commits added

  • fix: TypeError in irc, mail, noff, rtd_hook plugin
  • test(ui_plugins_irc): renamed to 'test_plugin_irc'
2 months ago

4 failed tests fixed with the latest two commits (TypeError: not all arguments converted during string formatting), test results local Container:

CentOS Stream 8 RPM: 1703 passed, 8 skipped, 4 warnings

Fedora 34 RPM: 1704 passed, 8 skipped, 2055 warnings

Fedora 34 PIP: 4 failed, 1700 passed, 8 skipped, 1413 warnings
FAILED tests/test_pagure_flask_ui_fork.py::PagureFlaskForktests::test_new_request_pull_fork_to_other_unrelated_fork - AssertionError: "<p>fork/foo/test is not part of fork/ralph/test2's family</p>" not found in '<!doctype html>\n<htm...
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_delete_repo - AssertionError: '<span>\n              <i class="fa fa-calendar-o fa-rotate-270 fa-fw text-muted"></i>\n              <span class="d-none d-md-inline...
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_delete_repo_when_turned_off - AssertionError: '<span class="btn btn-outline-secondary disabled opacity-100 border-0 ml-auto font-weight-bold">3 Projects</span>' no...
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_edit_file - AssertionError: '<title>Commits - test - Pagure</title>' not found in '\n<!DOCTYPE html>\n<html lang=\'en\'>\n<head>\n    <meta http-equiv="Content-Typ...

Fedora 36 RPM: 3 failed, 1701 passed, 8 skipped, 4406 warnings
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_delete_repo - AssertionError: '<span>\n              <i class="fa fa-calendar-o fa-rotate-270 fa-fw text-muted"></i>\n              <span class="d-none d-md-inline...
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_delete_repo_when_turned_off - AssertionError: '<span class="btn btn-outline-secondary disabled opacity-100 border-0 ml-auto font-weight-bold">3 Projects</span>' no...
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_edit_file - AssertionError: '<title>Commits - test - Pagure</title>' not found in '\n<!DOCTYPE html>\n<html lang=\'en\'>\n<head>\n    <meta http-equiv="Content-Typ...

Fedora 36 PIP: 4 failed, 1700 passed, 8 skipped, 1411 warnings
FAILED tests/test_pagure_flask_ui_fork.py::PagureFlaskForktests::test_new_request_pull_fork_to_other_unrelated_fork - AssertionError: "<p>fork/foo/test is not part of fork/ralph/test2's family</p>" not found in '<!doctype html>\n<htm...
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_delete_repo - AssertionError: '<span>\n              <i class="fa fa-calendar-o fa-rotate-270 fa-fw text-muted"></i>\n              <span class="d-none d-md-inline...
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_delete_repo_when_turned_off - AssertionError: '<span class="btn btn-outline-secondary disabled opacity-100 border-0 ml-auto font-weight-bold">3 Projects</span>' no...
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_edit_file - AssertionError: '<title>Commits - test - Pagure</title>' not found in '\n<!DOCTYPE html>\n<html lang=\'en\'>\n<head>\n    <meta http-equiv="Content-Typ...

3 new commits added

  • fix: returned html entities ascii instead unicode
  • fix: 'NoneType' object has no attribute 'replace'
  • fix(query): filtered records part of results
2 months ago

Quite successful, Jenkins builds are fine, why I have two tests fail in my local F34 pip container is something I have to dig deeper today, but can't be a huge thing anymore.

Jenkins CI
----------

F34 RPM: 1705 passed, 7 skipped, 2059 warnings

C8S RPM: 1703 passed, 8 skipped, 4 warnings

F34 PIP: 1704 passed, 8 skipped, 1621 warnings


Local Container
---------------

F34 RPM: 1704 passed, 8 skipped, 2055 warnings

C8S RPM: 1703 passed, 8 skipped, 4 warnings

F34 PIP: 2 failed, 1702 passed, 8 skipped,
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_renew_api_token - AssertionError: datetime.date(2023, 7, 22) != datetime.date(2023, 7, 23)
FAILED tests/test_pagure_flask_ui_repo.py::PagureFlaskRepotests::test_revoke_api_token - AssertionError: datetime.date(2023, 7, 22) != datetime.date(2023, 7, 23)

F36 RPM: 1704 passed, 8 skipped, 4560 warnings

F36 PIP: 1704 passed, 8 skipped, 1566 warnings

After checking the relevant assert:

            self.assertEqual(
                repo.tokens[0].expiration.date(),
                datetime.datetime.utcnow().date()
                + datetime.timedelta(days=(30 * 6)),
            )

It looks like that the tests failed because I was running them around midnight in my local environment, the way the diff is calculated and checked doesn't work in such an edge case. Was just running the exact same test again and everything went fine. So yeah it could be improved but for now I think it's good enough.

WIP removed, ready for Review @ngompa @pingou, scope was to fix failed jobs with different OS and package versions. There are tons of deprecation warnings and other things that need work and optimization, but that's a different story and will handled in other PRs at a later point.

The restrictions in the requirements*.txt files will make pagure uninstallable on Fedora when packaged. We do need to have this fixed so pagure works without pinned dependencies...

I agree with Neal there, I very much dislike restrictions in requirements*.txt unless we know for sure we're incompatible with a version (or range of).

The restrictions in the requirements*.txt files will make pagure uninstallable on Fedora when packaged. We do need to have this fixed so pagure works without pinned dependencies...

So you say it's impossible to build a fedora package if any python package in the requirements file has a limit on the allowed version? I called it pinned, but it's actually a range of versions, in nearly no case just one specific.

I agree with Neal there, I very much dislike restrictions in requirements*.txt unless we know for sure we're incompatible with a version (or range of).

It's not that really like and prefer it, but what I can see it will be nearly impossible to get the unit tests and also pagure, in the condition it is right now, stable in a pip environment without it. I tried for days to satisfy very old and bleeding edge versions until I decided to set a limit.

To make my changes and decisions easier to understand, I put a lot of additional information and comments into the commits, see:

build(requirements): pin python package versions
https://pagure.io/fork/wombelix/pagure/c/c9376756f7097d66f5ea6b06a95ab00d80298b63

build(requirements): pin 'itsdangerous' to < 2.1
https://pagure.io/fork/wombelix/pagure/c/7d6573a31c17bff662f618f923dd0eb6e5c9b385

Lot of packages removed long deprecated functionality and / or introduced breaking changes in the latest versions.

In a major release 6.0, which is in my opinion very far away given the amount of issues in relation to active contributor, it will probably be possible again to only set minimum requirements, but until then I think we need it to move forward.

I would like to see further bug fixes and some features released as new 5.13 versions. Also to demonstrate that the project is still alive, makes progress and hopefully to attract further contributors.

Only focusing on 6.0 without any idea how long this will take could bring us in a MoinMoin Wiki situation, where version 1 is unmaintained since years but version 2 is still far away from a release.

Thoughts? Ideas?

I'm giving +1 to this, first success CI run in a while.

build(requirements): pin python package versions
https://pagure.io/fork/wombelix/pagure/c/c9376756f7097d66f5ea6b06a95ab00d80298b63

These pins basically break shipping on Fedora 37+ and openSUSE Tumbleweed.

build(requirements): pin 'itsdangerous' to < 2.1
https://pagure.io/fork/wombelix/pagure/c/7d6573a31c17bff662f618f923dd0eb6e5c9b385

The pin for itsdangerous basically means we can't ship Pagure in Fedora 38+ or openSUSE Tumbleweed.

I can certainly merge this, but we can't release like this.