Skip to content

cram directory tests: skip empty directories - #3753

Merged
emillon merged 2 commits into
ocaml:masterfrom
emillon:cram-directories-empty-ok
Sep 2, 2020
Merged

emillon merged 2 commits into
ocaml:masterfrom
emillon:cram-directories-empty-ok

Conversation

@emillon

@emillon emillon commented Aug 31, 2020

Copy link
Copy Markdown
Collaborator

In the case of cram directory tests (directories with a name that ends in .t), there's a check that they contain a run.t file. When that is not the case, the build errors out.

It can cause problems because empty directories are not tracked by git. An update can leave empty directories behind, which can make builds fail in a mysterious way.

This relaxes the existing check by skipping empty directories.

@emillon
emillon requested a review from rgrinberg August 31, 2020 16:37
@emillon
emillon force-pushed the cram-directories-empty-ok branch from 53c7eef to 879dd0f Compare August 31, 2020 16:43

@rgrinberg rgrinberg left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks ok. Another option is to make this a warning.

PS we need a CHANGES entry

@emillon
emillon force-pushed the cram-directories-empty-ok branch from 879dd0f to e76a357 Compare September 1, 2020 07:51
@emillon

emillon commented Sep 1, 2020

Copy link
Copy Markdown
Collaborator Author

cool, thanks. Also, I noticed that there are no tests for this. I'll try to test that in a cram test itself.

@emillon

emillon commented Sep 1, 2020

Copy link
Copy Markdown
Collaborator Author

Done. That was a bit weird due to kinds.t being visible in the test case itself, but using dune runtest on subdirectories worked out pretty fine.

In the case of cram directory tests (directories with a name that ends
in .t), there's a check that they contain a `run.t` file. When that is
not the case, the build errors out.

It can cause problems because empty directories are not tracked by git.
An update can leave empty directories behind, which can make builds fail
in a mysterious way.

This relaxes the existing check by skipping empty directories.

Signed-off-by: Etienne Millon <[email protected]>
Signed-off-by: Etienne Millon <[email protected]>
@emillon
emillon force-pushed the cram-directories-empty-ok branch from 9f987be to 0c6c7ca Compare September 2, 2020 15:25
@emillon
emillon merged commit 99a4b3a into ocaml:master Sep 2, 2020
@emillon
emillon deleted the cram-directories-empty-ok branch September 2, 2020 15:27
rgrinberg added a commit to rgrinberg/opam-repository that referenced this pull request Sep 3, 2020
…lugin, dune-private-libs and dune-glob (2.7.1)

CHANGES:

- configurator: More flexible probing of `#define`. We allow duplicate values in
  the object file, as long as they are the same after parsing. (ocaml/dune#3739, fixes
  ocaml/dune#3736, @rgrinberg)

- Record instrumentation backends in dune-package files. This makes it possible
  to use instrumentation backends defined in installed libraries (eg via OPAM).
  (ocaml/dune#3735, @nojb)

- Add missing `.aux` & `.glob` targets to coq rules (ocaml/dune#3721, fixes ocaml/dune#3437,
  @rgrinberg)

- Fix `dune-package` installation when META templates are present (ocaml/dune#3743, fixes
  ocaml/dune#3746, @rgrinberg)

- Resolve symlinks before running `$ git diff` (ocaml/dune#3750, fixes ocaml/dune#3740, @rgrinberg)

- Cram tests: when checking that all test directories contain a `run.t` file,
  skip empty directories. These can be left around by git. (ocaml/dune#3753, @emillon)
rgrinberg added a commit to rgrinberg/opam-repository that referenced this pull request Sep 5, 2020
…lugin, dune-private-libs and dune-glob (2.7.1)

CHANGES:

- configurator: More flexible probing of `#define`. We allow duplicate values in
  the object file, as long as they are the same after parsing. (ocaml/dune#3739, fixes
  ocaml/dune#3736, @rgrinberg)

- Record instrumentation backends in dune-package files. This makes it possible
  to use instrumentation backends defined in installed libraries (eg via OPAM).
  (ocaml/dune#3735, @nojb)

- Add missing `.aux` & `.glob` targets to coq rules (ocaml/dune#3721, fixes ocaml/dune#3437,
  @rgrinberg)

- Fix `dune-package` installation when META templates are present (ocaml/dune#3743, fixes
  ocaml/dune#3746, @rgrinberg)

- Resolve symlinks before running `$ git diff` (ocaml/dune#3750, fixes ocaml/dune#3740, @rgrinberg)

- Cram tests: when checking that all test directories contain a `run.t` file,
  skip empty directories. These can be left around by git. (ocaml/dune#3753, @emillon)
@Alizter Alizter added this to the 2.7.1 milestone Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants