9.2 just docker-shell and just docker-test
Build it yourself. Read the tutorial is the other way to read this part.
This walk goes through rahuldave/cheesecracker on GitHub. This part starts from the code at ccf62d330f28, partway through step-09. The code before this part
This part does not start where the part before it ends, because the walk skips some changes. This command puts the files that this part starts from in place of yours. Run it, and then go on:
git fetch --quiet --tags --force origin; git restore --source step-08 --staged -- :/ && git restore --source ccf62d330f28 --staged --worktree -- :/If you start at this part, make your clone as Get the project says, and then run this command. It puts in your clone the files that this part starts from. A file that the project deleted before this part stays, so delete it if git check lists it:
git rm -rq --cached --ignore-unmatch -- :/ && git restore --source ccf62d330f28 --staged --worktree -- :/just setup
just docker-build devThe whole tutorial then adds the dev image to the Dockerfile. Two recipes run it, with the folder of the project
mounted inside.
9.2 just docker-shell and just docker-test
Two recipes run the dev image with this folder mounted at /work. An edit here shows in there at once, so the image
needs no rebuild after a change of the code. docker-shell opens a shell in the image. docker-test runs the recipe
that you name in the image, or just check if you name none.
Apply the patch to justfile, from the top of the project:
curl -fsSL https://github.com/rahuldave/cheesecracker/commit/0701e9244ab2384538eda4d623e1d047ff3f8258.diff | git apply --include=justfileRead the recipes docker-shell and docker-test at the end of the justfile.
just docker-testjust check runs in Linux. The last line is 21 passed. The system tests do not run, because just check leaves them
out.
just docker-test test tests/unit -qThe eleven unit tests pass in Linux.
Check your files against this move. The command prints nothing when they match, and otherwise shows what differs:
git check 0701e9244ab2If you are stuck, this command puts the files of this move in place of yours. A file that you made yourself stays:
git fetch --quiet --tags --force origin; git restore --source ccf62d330f28 --staged -- :/ && git restore --source step-09 --staged --worktree -- :/What changed
justfile: the recipesdocker-shellanddocker-test. 8 lines added. The file- look at
docker run --rm -v "$PWD":/work cheesecracker-dev just "${@:-check}"
- look at
The patch to justfile
@@ -86,3 +86,11 @@ docker-stop:
# Run the system tests against the server at http://localhost:9000. They fail when no server answers there
test-system *args:
uv run pytest tests/system "$@"
+
+# A shell in the dev image, with this folder mounted at /work: an edit here shows in there at once
+docker-shell:
+ docker run --rm -it -v "$PWD":/work cheesecracker-dev
+
+# Run a recipe in the dev image, with this folder mounted at /work. Alone, just check: just docker-test test tests/unit
+docker-test *args:
+ docker run --rm -v "$PWD":/work cheesecracker-dev just "${@:-check}"This part ends at the code at step-09. The code after this part