psalm / codeception-psalm-module

Codeception module providing assertions and Gherkin snippets to help with Psalm acceptance testing
MIT License
5 stars 7 forks source link

query: re psalm cache & docker #50

Closed SignpostMarv closed 1 year ago

SignpostMarv commented 1 year ago

Running codecept via a docker run command in a Makefile with the --user $(shell id -u):$(shell id -g) command seems to have your codeception psalm function be unable to create cache directories, despite psalm having no issue creating cache directories when run directly under a similar command.

Is there something in particular I'm missing here?

weirdan commented 1 year ago

Running codecept -vvv other args here should provide more information on what's going on.

SignpostMarv commented 1 year ago

have found the issue;

the codecept Module isn't using the project's xml config so the default cache path attempts to get used, which isn't mounted in the docker image.

@weirdan would there be any issue with defaulting codecept to run with --no-cache specified unless instructed not to?

SignpostMarv commented 1 year ago

note: the workaround for this issue appears to be using --volume=$(shell pwd)/.build/psalm:${HOME}/.cache/psalm

weirdan commented 1 year ago

would there be any issue with defaulting codecept to run with --no-cache specified unless instructed not to?

I think it would conflict with the I have the following psalm config feature. But you can use this very feature to override psalm's cache directory (see below). You can stick that into the Background section, so you don't have to repeat it for every case.

https://github.com/psalm/codeception-psalm-module/blob/89a1bac1a1aeb9c47aa9ade6ffaf9876f73181f5/tests/acceptance/PsalmModule.feature#L86-L98

SignpostMarv commented 1 year ago

Given that the issue is docker-specific and it's solved by lazily mapping ./.build/psalm onto ~/.cache/psalm, I'm going to consider this a non-issue now :D

ty for the assistance :)