This question already has an answer here:
- Exclude one pattern from glob match 3 answers
I have a folder filled with 9 Robot Framework test files. Only 8 of them have to be executed, as the last one is used to set up all the others (let's call it
If I had to run all those tests I would have done something like
for test_file in folder/*.robot; do robot -b debug.log -d log/ $test_file.robot; done
but in this case it means that
config.robot will also be run, which I don't want.
How could I perform a for loop on all files in folder except one?
If that helps, all files except
config.robot respect the following naming syntax: they all start with their execution order and are followed by their actual name, e.g.
Edit: Before posting that question I had already seen and tried the answers offered in Exclude one pattern from glob match and wrote something similar to
shopt -s extglob for test_file in folder/!(config).robot; do ...
But Robot Framework does not recognize the file name:
Parsing 'folder/!(config).robot' failed: Data source does not exist.
so I guess that Robot Framework doesn't like that syntax.
I'm thinking about setting a variable with the results of a find according to a regex matching my filename structure and then performing the for loop on the variable:
SUITES=$(find . -regex '^[0-9][0-9][a-zA-Z_-]*') for SUITE in $SUITES; do robot -b ...
But for some reason when I
echo SUITES it returns nothing. I don't know what I missed here.