8000 JUnit Reporter Missing Test Count · Issue #6161 · realm/SwiftLint · GitHub
[go: up one dir, main page]

Skip to content

JUnit Reporter Missing Test Count #6161

@kbarnesMCC

Description

@kbarnesMCC

New Issue Checklist

Bug Description

Coming out of PR #4725 updates were made to enhance the JUnit reporting with additional details that are necessary for some pipeline engines; specifically Bitbucket.

Unfortunately, one aspect of that PR was seemingly dropped, namely the "total tests count" which we're finding appears to be a requirement for Bitbucket ingestion in particular. For example, we're getting this message as Bitbucket's JUnit parsing logic:

Merged test suites, total number tests is 0, with 0 failures and 2 errors.

While it properly detects the presence of failures/errors per that referenced PR's changes; it's detecting 0 tests which we believe it causing them to disable all their UI integrations for reporting from this file.

The JUnit Complete Reference Example shows this as simply adding a "tests" attribute to both "testsuites" and "testsuite" XML nodes.

Additionally, I suspect the "testsuite" XML nodes need a "name" property for effective rendering. Most other tools I've seen (e.g. eslint in the Javascript world) would populate this simply as the filename though depending on how Swiftlint marshals this file maybe the linting rule is more appropriate or even just a single "SwiftLint" name if everything is marshalled under a single "testsuite".

Environment

  • SwiftLint version: 0.59.1
  • Xcode version: 16.4 Build 16F6
  • Installation method used: Homebrew
  • Configuration file:
disabled_rules:
  - file_length
  - function_body_length
  - line_length
  - type_body_length

opt_in_rules:
  - conditional_returns_on_newline
  - contains_over_filter_count
  - contains_over_filter_is_empty
  - contains_over_first_not_nil
  - contains_over_range_nil_comparison
  - empty_collection_literal
  - empty_string
  - explicit_init
  - fatal_error_message
  - first_where
  - flatmap_over_map_reduce
  - identical_operands
  - implicit_return
  - joined_default_parameter
  - last_where
  - legacy_multiple
  - let_var_whitespace
  - multiline_function_chains
  - multiline_literal_brackets
  - object_literal
  - optional_enum_case_matching
  - prefer_self_in_static_references
  - prefer_self_type_over_type_of_self
  - prefer_zero_over_explicit_init
  - reduce_into
  - redundant_nil_coalescing
  - redundant_type_annotation
  - return_value_from_void_function
  - sorted_first_last
  - static_operator
  - toggle_bool
  - trailing_closure
  - unavailable_function
  - untyped_error_in_catch
  - xct_specific_matcher

conditional_returns_on_newline:
  if_only: true

opening_brace:
  ignore_multiline_statement_conditions: true

identifier_name:
  min_length:
    warning: 0
    error: 0
  max_length:
    warning: 9999
    error: 9999
  unallowed_symbols_severity: warning
  validates_start_with_lowercase: warning

type_name:
  max_length:
    warning: 60

Are you using nested configurations? If so, paste their
relative paths and respective contents.

Not applicable

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementIdeas for improvements of existing features and rules.good first issueIssue to be taken up by new contributors yet unfamiliar with the project.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0