Skip to content

cram directory tests: skip empty directories#3753

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

cram directory tests: skip empty directories#3753
emillon merged 2 commits intoocaml:masterfrom
emillon:cram-directories-empty-ok

Conversation

@emillon
Copy link
Copy Markdown
Collaborator

@emillon emillon commented Aug 31, 2020

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
Copy link
Copy Markdown
Member

@rgrinberg rgrinberg left a comment

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
Copy link
Copy Markdown
Collaborator Author

emillon commented Sep 1, 2020

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

@emillon
Copy link
Copy Markdown
Collaborator Author

emillon commented Sep 1, 2020

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 <me@emillon.org>
Signed-off-by: Etienne Millon <me@emillon.org>
@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)
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.

2 participants