Skip to content

Issue a warning when there are conflict markers in test files #12512

@georgiy-belyanin

Description

@georgiy-belyanin

Desired Behavior

dune runtest ignores any line that does not start with whitespace in .t files . It is handy for describing the tests but it has some unintended consequences: merge-conflict markers (i.e. <<<<<<<<) are completely ignored by dune.

The latter combined with the auto-promote feature can lead to the following scenario.

  • A user rebases on a branch with conflicts inside test .t files.
  • He observes a lot of conflicts and resolve them.
  • The user forgets about conflict markers in the tests and runs dune runtest --auto-promote.
  • The tests are successfully promoted.
  • The conflict markers remain in the tests since they have been ignored both by dune and by the user due to many changes in the test output.

Example

Dune might issue a warning if it detects tests with conflict markers. For instance if we have the following tests/1.t file.

  $ Chro input1.smt2
  unsat

<<<<<<< HEAD
=======
>>>>>>> ee7647e4 (project: add feature)

  $ Chro input.smt2
  sat (underapprox1)

Running this test may result with the following warning.

Merge conflict markers detected in `tests/1.t` on lines 3-5

Metadata

Metadata

Assignees

No one assigned

    Labels

    cramRelated to the cram test execution in Dunefeature-requestUser wanted features

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions