Closed DimaOwena closed 2 years ago
APIFuzzer is failing for the CI integration .
CI script : stage: validate
image:
variables: SEARCH_DIR: "./reference" script:
cat /etc/os-release
apt-get update
apt-get -y install python3-pip tree
python3 -m pip install --upgrade pip
pip3 --version
apt-get -y install gcc libcurl4-nss-dev python3-dev
git clone https://github.com/KissPeter/APIFuzzer.git && tree
pip3 install -r APIFuzzer/requirements.txt
APIFuzzer/APIFuzzer -v && APIFuzzer/APIFuzzer -h
mkdir reports && pwd && ls -lh
| for file in find ${SEARCH_DIR} -type f -name "*.yaml" do echo "##### Run APIFuzzer #####"; echo "Run APIFuzzer/APIFuzzer -s ${file} -r ./reports/ --log debug"; APIFuzzer/APIFuzzer -s ${file} -r ./reports/ --log debug;
find ${SEARCH_DIR} -type f -name "*.yaml"
done
error: [32;1m$ for file in find ${SEARCH_DIR} -type f -name "*.yaml" # collapsed multi-line command[0;m
Run APIFuzzer/APIFuzzer -s ./reference/authentication/demo.yaml -r ./reports/ --log debug 1024 [ INFO] APIFuzzer [fuzzer.py:34 - __init__ ]: APIFuzzer 0.9.13 initialized 1024 [ INFO] APIFuzzer.JsonSectionAbove-schema [move_json_parts.py:48 - resolve ]: Resolving schema references 1024 [ DEBUG] APIFuzzer.JsonSectionAbove-schema [move_json_parts.py:55 - resolve ]: 1 resolving reference Traceback (most recent call last): File "APIFuzzer/APIFuzzer", line 94, in <module> prog.prepare() File "/builds/YHitoRqx/1/dir/doc/APIFuzzer/apifuzzer/fuzzer.py", line 40, in prepare template_generator = OpenAPITemplateGenerator( File "/builds/YHitoRqx/1/dir/doc/APIFuzzer/apifuzzer/openapi_template_generator.py", line 42, in __init__ self.api_resources = self.json_formatter.resolve() File "/builds/YHitoRqx/1/dir/doc/APIFuzzer/apifuzzer/move_json_parts.py", line 56, in resolve data, resolved_in_this_iteration = self._resolve(data) File "/builds/YHitoRqx/1/dir/doc/APIFuzzer/apifuzzer/move_json_parts.py", line 16, in _resolve self.logger.debug(f"Processing {pretty_print(data, 50)}") File "/builds/YHitoRqx/1/dir/doc/APIFuzzer/apifuzzer/utils.py", line 190, in pretty_print return json.dumps(printable, sort_keys=True)[0:limit] File "/usr/lib/python3.8/json/__init__.py", line 234, in dumps return cls( File "/usr/lib/python3.8/json/encoder.py", line 199, in encode chunks = self.iterencode(o, _one_shot=True) File "/usr/lib/python3.8/json/encoder.py", line 257, in iterencode return _iterencode(o, 0) During handling of the above exception, another exception occurred: Traceback (most recent call last): File "APIFuzzer/APIFuzzer", line 99, in <module> print(f'Unexpected exception happened during fuzz test preparation: {traceback.print_stack(*sys.exc_info())}.\n' File "/usr/lib/python3.8/traceback.py", line 190, in print_stack print_list(extract_stack(f, limit=limit), file=file) File "/usr/lib/python3.8/traceback.py", line 211, in extract_stack stack = StackSummary.extract(walk_stack(f), limit=limit) File "/usr/lib/python3.8/traceback.py", line 340, in extract if limit >= 0: TypeError: '>=' not supported between instances of 'ValueError' and 'int' section_end:1656922805:step_script [0Ksection_start:1656922805:cleanup_file_variables [0K[0K[36;1mCleaning up file based variables[0;m [0;msection_end:1656922805:cleanup_file_variables [0K[31;1mERROR: Job failed: command terminated with exit code 1 [0;m
Thanks for reporting, checking it soon
Can you please try it out now?
still failing, thanks @KissPeter .
Can you please paste here the exception you áré getting?
APIFuzzer is failing for the CI integration .
CI script : stage: validate
image:
variables: SEARCH_DIR: "./reference" script:
cat /etc/os-release
apt-get update
apt-get -y install python3-pip tree
python3 -m pip install --upgrade pip
pip3 --version
apt-get -y install gcc libcurl4-nss-dev python3-dev
git clone https://github.com/KissPeter/APIFuzzer.git && tree
pip3 install -r APIFuzzer/requirements.txt
APIFuzzer/APIFuzzer -v && APIFuzzer/APIFuzzer -h
mkdir reports && pwd && ls -lh
| for file in
find ${SEARCH_DIR} -type f -name "*.yaml"
do echo "##### Run APIFuzzer #####"; echo "Run APIFuzzer/APIFuzzer -s ${file} -r ./reports/ --log debug"; APIFuzzer/APIFuzzer -s ${file} -r ./reports/ --log debug;npx ibm-openapi-validator ${file};
done
error: [32;1m$ for file in
find ${SEARCH_DIR} -type f -name "*.yaml"
# collapsed multi-line command[0;mRun APIFuzzer