nextcloud / nextcloud/cookbook

Enhance testing of backend

Open
#2,388 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

meta and development
Dominant language
HTML
Stars
641
Forks
113
Avg merge
21h 31m
Merged PRs (30d)
26

Description

In the Matrix channel some flaws of the automatic testing were reported:

  • I found it necessary to uncomment PHP_VERSION in .github/actions/run-tests/docker-compose.yml in the dut service's build args, or --create-images fails
  • Also had to change PHP_VERSION from 7 to 8, or perl exploded
  • I preferred not to install PHP and Composer in my host environment; used docker instead
    • After run-locally --create-images you've got what you need
    • From cookbook repo dir on host: docker run -it -w /cookbook --rm -v $PWD:/cookbook --entrypoint composer cookbook_unittesting_fpm install
  • When running --create-fixture, I didn't realize initially that the version is a branch or tag in the Nextcloud server repo. It makes sense, but I didn't know, and just setting master doesn't work because Cookbook doesn't expect to run against that version.
  • If I create a test fixture with sqlite, tests pass the first time only. Subsequent runs have a litany of missing table errors. Using mysql works as expected.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with .github/actions/run-tests/docker-compose.yml and the run-locally paths for --create-images and --create-fixture. Reproduce the reported Docker, PHP version, fixture-version, and SQLite rerun problems, then verify that image creation and repeated fixture-based test runs work without the reported errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, mysql, perl, php, sqlite
Domain
backend, ci-cd, testing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.