Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,36 @@ go test -v ./libpod/
go test -v -run TestMyFunction ./pkg/specgen/
```

## Reproducing CI failures locally with lima

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.

I would move this to the end of the file, it is normally not needed by most users as running a test directly on the system is faster as it does not need to pull these huge qcow images.


`hack/ci/ci.sh` runs a CI test suite inside the same lima VM image used by
upstream CI. The script requires `limactl`, starts a nested-virtualization VM

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.

This should link to lima https://lima-vm.io/docs/installation/

with 8 GB of memory, copies this repository into the VM, and runs
`hack/ci/runner.sh` there, so the host distro does not matter.

The invocation is positional and takes 2 to 4 arguments:

```bash
hack/ci/ci.sh TEST DISTRO
hack/ci/ci.sh TEST PRIV DISTRO
hack/ci/ci.sh TEST MODE PRIV DISTRO
```

`TEST` is the suite, one of `build`, `apiv2`, `bindings`, `bud`, `compose_v2`,
`docker_py`, `unit`, `upgrade`, `int`, `sys`, or `machine`. `MODE` is `local`
or `remote` and defaults to `local`. `PRIV` is `root` or `rootless` and defaults
to `rootless`. `DISTRO` must be one of `fedora-current`, `fedora-prior`,
`fedora-rawhide`, or `debian-sid`.
Comment on lines +60 to +64

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I don't like this style listing. I would use a proper list, for example:

TEST is the suite, one of:

  • build builds something
  • unit runs unit tests
  • ...

Comment on lines +52 to +64

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.

While that is fine it misses the main point, the CI task names are design to follow this exact pattern so for a specific CI failure a user just has to copy paste the name, i.e. the part before / lima


For the `upgrade` suite the `MODE` slot is reused to pass the version to upgrade
from (e.g. `v5.3.1`) rather than `local`/`remote`.

```bash
hack/ci/ci.sh sys remote rootless fedora-current
```

Some parts of the test suite cannot run inside the VM.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Which of them? I would list them.

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.

any CI job that is called / lima is run inside the VM and can thus be run here, anything else can not be run in the VM, i.e machine tests, windows/macos...


# Test utils
Test utils provide common functions and structs for testing. It includes two structs:
* `PodmanTest`: Handle the *podman* command and other global resources like temporary
Expand Down
Loading