Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

irmin-graphql: use irmin-mem in tests #995

Merged
merged 4 commits into from
Apr 17, 2020

Conversation

craigfe
Copy link
Member

@craigfe craigfe commented Apr 16, 2020

The test-suite introduced by #989 was accidentally attached to the irmin-git package, causing CI for irmin-git to fail in Travis (but not in OCaml-CI, since these cross-package bugs are not caught there).

Only one of the two failures on that PR were "unrelated"...

@craigfe craigfe changed the title irmin-graphql: fix package attachment of new test suite irmin-graphql: use irmin-mem in tests Apr 16, 2020
@craigfe craigfe force-pushed the fix-graphql-test-suite branch from afce8c9 to 545393e Compare April 16, 2020 12:49
craigfe added 2 commits April 16, 2020 14:49
The test-suite introduced by mirage#989
was accidentally attached to the `irmin-git` package, causing CI for
`irmin-git` to fail in Travis (but not in OCaml-CI, since these
cross-package bugs are not caught there).

Only _one_ of the two failures on that PR were "unrelated"...
@craigfe craigfe force-pushed the fix-graphql-test-suite branch from 545393e to 4a0f9b8 Compare April 16, 2020 12:50
@craigfe
Copy link
Member Author

craigfe commented Apr 16, 2020

As discussed offline, simply attaching these tests to the irmin-graphql package does not work, since they depend on irmin-unix (which in turn depends on irmin-graphql...). A simple solution is to just use irmin-mem as a backend store for these tests, which makes more sense anyway 🙂

A minor niggle is that Irmin_mem.KV does not expose its metadata type (so it's impossible to import concrete trees). That is fixed here.

@craigfe craigfe force-pushed the fix-graphql-test-suite branch from 4a0f9b8 to 42a5813 Compare April 16, 2020 12:57

module KV : Irmin.KV_MAKER
(** An in-memory KV store. *)
(** Constructor for in-memory KV stores. Subtype of {!Irmin.KV_MAKER}. *)
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure if there's a way to make this clearer in the documentation. Needing to manually expand Irmin.KV_MAKER is a pain.

@craigfe craigfe force-pushed the fix-graphql-test-suite branch from 42a5813 to c537e22 Compare April 16, 2020 13:03
@samoht samoht merged commit ecc11c1 into mirage:master Apr 17, 2020
@samoht
Copy link
Member

samoht commented Apr 17, 2020

Thanks!

craigfe added a commit to craigfe/opam-repository that referenced this pull request Jun 26, 2020
…min-mirage-graphql, irmin-http, irmin-git, irmin-mem, irmin-mirage, irmin-unix, irmin-pack, irmin-graphql and irmin-mirage-git (2.2.0)

CHANGES:

#### Added

- **irmin**:
  - Added `Irmin.Type.empty` to represent an uninhabited type. (mirage/irmin#961, @craigfe)
  - Added `Store.Tree.concrete_t`. (mirage/irmin#1003, @craigfe)

- **ppx_irmin**
  - Added support for the `@nobuiltin` attribute, which can be used when
    shadowing primitive types such as `unit`. See `README_PPX` for details.
    (mirage/irmin#993, @craigfe)

  - Added support for a `lib` argument, which can be used to supply primitive
    type representations from modules other than `Irmin.Type`. (mirage/irmin#994, @craigfe)

#### Changed

- **irmin**:
  - Require OCaml 4.07 (mirage/irmin#961, @craigfe)
  - Add sanity checks when creating `Irmin.Type` records, variants and enums
    (mirage/irmin#956 and mirage/irmin#966, @liautaud):
     - `Irmin.Type.{sealr,sealv,enum}` will now raise `Invalid_argument` if two
       components have the same name;
     - `Irmin.Type.{field,case0,case1}` will now raise `Invalid_argument` if
       the component name is not a valid UTF-8 string.
  - Changed the JSON encoding of options and unit to avoid ambiguous cases
    (mirage/irmin#967, @liautaud):
    - `()` is now encoded as `{}`;
    - `None` is now encoded as `null`;
    - `Some x` is now encoded as `{"some": x}`;
    - Fields of records which have value `None` are still omitted;
    - Fields of records which have value `Some x` are still unboxed into `x`.

  - Changed pretty-printing of Irmin types to more closely resemble OCaml types.
    e.g. `pair int string` prints as `int * string`. (mirage/irmin#997, @craigfe)

  - The type `Irmin.S.tree` is now abstract. The previous form can be coerced
    to/from the abstract representation with the new functions
    `Irmin.S.Tree.{v,destruct}` respectively. (mirage/irmin#990, @craigfe)

- **irmin-mem**
  - Stores created with `KV` now expose their unit metadata type. (mirage/irmin#995,
    @craigfe)

#### Fixed

- **irmin-graphql**
  - Fixed an issue with keys inside `get_{contents,tree}` fields having
    incorrect ordering (mirage/irmin#989, @craigfe)
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