Closed eeslook closed 2 weeks ago
Hi @eeslook, IIUIC you created your own resolver which can resolve .yml
files into tests. Then you have suite with your YAML files and executable files, but the avocado will resolve the YAML files as exec-test
because it uses exec-test
resolver before your own YAML resolver, am I right? If this is the case, then you can set priority of your plugin to VERY_HIGH
. It will ensure that your plugin will always resolve the files before the exec-test resolver. For more info, see https://avocado-framework.readthedocs.io/en/latest/guides/contributor/chapters/plugins.html#plugins-execution-order
Hi @eeslook, IIUIC you created your own resolver which can resolve
.yml
files into tests. Then you have suite with your YAML files and executable files, but the avocado will resolve the YAML files asexec-test
because it usesexec-test
resolver before your own YAML resolver, am I right? If this is the case, then you can set priority of your plugin toVERY_HIGH
. It will ensure that your plugin will always resolve the files before the exec-test resolver. For more info, see https://avocado-framework.readthedocs.io/en/latest/guides/contributor/chapters/plugins.html#plugins-execution-order
Thank you very much for your reply! I indeed created a custom resolver to handle .yml files and convert them into tests. Before submitting this bug, I was aware of the plugin priority settings and realized that adjusting the priority could serve as a workaround for this issue. However, considering that there are currently issues with exec-test permission checks within Docker images on macOS systems, and given that our project also includes other types of files such as .py and bins, with some .py files requiring specific plugins for parsing and others needing the exec-test, if the determination of file executable permissions is not accurate, it will always pose a risk. Therefore, I decided to report this issue and have also proposed a code-level fix.
Hi @eeslook, IIUIC you created your own resolver which can resolve
.yml
files into tests. Then you have suite with your YAML files and executable files, but the avocado will resolve the YAML files asexec-test
because it usesexec-test
resolver before your own YAML resolver, am I right? If this is the case, then you can set priority of your plugin toVERY_HIGH
. It will ensure that your plugin will always resolve the files before the exec-test resolver. For more info, see https://avocado-framework.readthedocs.io/en/latest/guides/contributor/chapters/plugins.html#plugins-execution-orderThank you very much for your reply! I indeed created a custom resolver to handle .yml files and convert them into tests. Before submitting this bug, I was aware of the plugin priority settings and realized that adjusting the priority could serve as a workaround for this issue. However, considering that there are currently issues with exec-test permission checks within Docker images on macOS systems, and given that our project also includes other types of files such as .py and bins, with some .py files requiring specific plugins for parsing and others needing the exec-test, if the determination of file executable permissions is not accurate, it will always pose a risk. Therefore, I decided to report this issue and have also proposed a code-level fix.
I see, I just have looked at your #5946, and we can discuss the details there. Thank you very much for your contribution.
ok
Describe the bug On macOS Sonoma v14.5, it was discovered that when using avocado in a Docker container to run scripts without execute permissions, they are considered to have executable permissions.
Steps to reproduce
Dockerfile-test
with flow content:docker build -t avocado-test:v1 -f Dockerfile-test .
example/00-most-simple-workflow-only-must-options.yml
at current dirchmod -x example/00-most-simple-workflow-only-must-options.yml
docker run -ti -v $PWD:/it avocado-test:v1 bash
cd /it && avocado -V list example/00-most-simple-workflow-only-must-options.yml
, return:Expected behavior I have an avocado plugin for example/00-most-simple-workflow-only-must-options.yml to run the scripts. I have exec-test script too, I hope the yml file run with my avocado plugin and the excutable files run with exec-test.
Current behavior I run the scripts on Linux with docker is ok, but failed when on macos with docker, because the exec-test runner matched first.
I have both exec-test and workflow tests in the testsuites.
System information (please complete the following information):
uname -a
, Darwin mymacbook 23.5.0 Darwin Kernel Version 23.5.0: Wed May 1 20:13:18 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6030 arm64Additional information I debug the script in macos in the docker with command
python -m pdb /usr/local/bin/avocado -V list ist example/00-most-simple-workflow-only-must-options.yml
and diff with same step at linunx, get the point:By directly reading the file's permission bits, the
stat
method can provide more accurate permission check results, especially in cases where user context and file system characteristics might affect the behavior ofos.access
. This method is closer to the underlying implementation of the file system, thus providing consistent results across different environments (such as inside and outside Docker containers). After entering the container usingdocker exec -it container bash
, use thestat
command to check the file permission bits: