Skip to content

A run configuration that changes only Testo's own fields is saved without them #171

Done

Description

@roxblnfk

Description

On PhpStorm a Testo run configuration whose PHP-plugin fields are all at their defaults is saved without any of its Testo fields: groups, types, suites, coverage and report options, Infection options. Setting only Group db on an otherwise default configuration writes <configuration />, so the group is gone after an IDE restart. The same write path serves clone() and the run archive, so a copy or a replayed run loses those fields too.

PhpRunConfiguration.writeExternal serializes with SkipDefaultValuesSerializationFilters, which drops the runner settings when they equals the default instance. TestoRunnerSettings does not override equals, and the inherited PhpTestRunnerSettings.equals compares only the PHP plugin's own fields (scope, paths, method, options, …). Once any of those differs, the whole <TestoRunnerSettings> element is written, Testo fields included, which is why typical configurations (with a scope or file set) are not affected.

Steps to reproduce

  1. Create a Testo run configuration from the template and change only Group (or only a coverage checkbox).
  2. Restart the IDE, or save and reload the project.
  3. The configuration has lost the change.

Additional context

Found while fixing #168; the fix (an equals/hashCode covering Testo's persisted fields) is in #169.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions