Skip to content
New issue

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

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

Already on GitHub? # to your account

Make xs-opam self-consistent and able to run unit tests #627

Merged
merged 5 commits into from
Feb 21, 2023

Conversation

edwintorok
Copy link
Contributor

Opam 2.x has changed how unit tests are run: they are only run for the packages explicitly specified on the command-line.
A lot of unit tests are in fact not runnable because we're missing a lot of test-only dependencies.
It is not even possible to install all test-only dependencies due to conflicts (mostly around versions of 'sexplib' and 'ppxlib'/etc.), so have a list of packages to exclude from running tests, by default we run tests for our own packages + their non-test-only dependencies, with a few exceptions.

Add packages to xs-opam that were previously missing or uninstallable.

After these changes running 'tools/cleanup.sh' and 'tools/find-unused-packages.sh' don't show any errors and running 'tools/installtest.sh' on a suitable opam trunk switch succeeds.

ca-certs had to be updated to version 0.2.3 because version 0.2.2 was failing its unit tests.

The extra dependencies are added to upstream-extra. Packages like 'bechamel' might become useful in other parts of the code (e.g. I have some code that uses it in some xenstore unit / performance tests).

Draft, because I only tested this on my own machine and not in Koji yet.

edwintorok and others added 5 commits February 13, 2023 16:00
--with-test behaves in a different way now: it only applies to packages you
explicitly list, and not their dependencies.

So first need to find out all the dependencies of xs-toolstack (that'll be all
our xs packages), and their recursive dependencies.
And we want the test dependencies of all of these (but not the test
dependencies of test-only packages, because that might pull in too many
packages and often it is not even possible to solve this with a consistent
version of packages, e.g. different packages may have conflicting constraints
on their test dependencies).

Also add some additional consistency check with another 'opam admin' command
that ignores doc and test dependencies (doc dependencies introduce cycles...)
that can help when updating opam packages.

Currently this prints an error that 'mdx' is not coinstallable, but that can be
solved by updating 'mdx'.

For debug purposes add a more direct installtest.sh that will install all these
packages.

Signed-off-by: Edwin Török <edvin.torok@citrix.com>
Signed-off-by: Edwin Török <edwin.torok@cloud.com>
Needed by eqaf tests.
Also in general useful for writing performance tests.

Signed-off-by: Edwin Török <edwin.torok@cloud.com>
ca-certs.0.2.2 was failing its unit tests on Fedora 37.

Signed-off-by: Edwin Török <edwin.torok@cloud.com>
The current version of 'mdx' is uninstallable with the package set in
xs-opam.
Updating 'mdx' to a newer version would make it installable, but it
pulls in a new 'odoc' which makes 'ocamlformat' uninstallable.

'mdx' is unused, so drop it for now. We can revisit this again during
the 4.14 update.

Signed-off-by: Edwin Török <edwin.torok@cloud.com>
@edwintorok edwintorok marked this pull request as ready for review February 14, 2023 14:40
@edwintorok edwintorok requested review from lindig and robhoes February 20, 2023 17:28
@edwintorok edwintorok merged commit 34595e1 into xapi-project:master Feb 21, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants