Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APIFuzzer is failing for the CI integration #57

Closed
DimaOwena opened this issue Aug 10, 2022 · 4 comments
Closed

APIFuzzer is failing for the CI integration #57

DimaOwena opened this issue Aug 10, 2022 · 4 comments
Labels

Comments

@DimaOwena
Copy link

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;m
##### Run APIFuzzer #####
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
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
@KissPeter KissPeter added the bug label Aug 10, 2022
@KissPeter
Copy link
Owner

Thanks for reporting, checking it soon

KissPeter added a commit that referenced this issue Aug 15, 2022
@KissPeter
Copy link
Owner

Can you please try it out now?

@DimaOwena
Copy link
Author

still failing, thanks @KissPeter .

@KissPeter
Copy link
Owner

Can you please paste here the exception you áré getting?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants