KissPeter / APIFuzzer

Fuzz test your application using your OpenAPI or Swagger API definition without coding
GNU General Public License v3.0
416 stars 65 forks source link

APIFuzzer is failing for the CI integration #57

Closed DimaOwena closed 2 years ago

DimaOwena commented 2 years ago

APIFuzzer is failing for the CI integration .

CI script : stage: validate

image:

variables: SEARCH_DIR: "./reference" script:

error: [32;1m$ for file in find ${SEARCH_DIR} -type f -name "*.yaml" # collapsed multi-line command

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 <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
  section_start:1656922805:cleanup_file_variables
  Cleaning up file based variables
  section_end:1656922805:cleanup_file_variables
  ERROR: Job failed: command terminated with exit code 1
  
KissPeter commented 2 years ago

Thanks for reporting, checking it soon

KissPeter commented 2 years ago

Can you please try it out now?

DimaOwena commented 2 years ago

still failing, thanks @KissPeter .

KissPeter commented 2 years ago

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