Skip to content

Commit

Permalink
refac: Improve the qa_docs, doc_generator and index_data logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
Luis Gonzalez committed Nov 3, 2021
1 parent 302e590 commit ce73ed5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 0 additions & 2 deletions deps/wazuh_testing/wazuh_testing/qa_docs/doc_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,6 @@ def run(self):
qa-docs -I ../../tests/ -T test_cache -o /tmp -> It would be running as `single test mode`
creating `/tmp/test_cache.json`
"""
DocGenerator.LOGGER.info('Starting test documentation parsing')

if self.conf.mode == Mode.DEFAULT:
DocGenerator.LOGGER.debug(f"Cleaning doc folder located in {self.conf.documentation_path}")
clean_folder(self.conf.documentation_path)
Expand Down
7 changes: 4 additions & 3 deletions deps/wazuh_testing/wazuh_testing/qa_docs/lib/index_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def read_files_content(self, files):
def remove_index(self):
"""Delete an index."""
delete = self.es.indices.delete(index=self.index, ignore=[400, 404])
IndexData.LOGGER.info(f'Delete index {self.index}\n {delete}\n')
IndexData.LOGGER.info(f'Deleting the already existing index: {self.index}')


def run(self):
Expand All @@ -110,7 +110,8 @@ def run(self):
except Exception:
pass

IndexData.LOGGER.info("Indexing data...\n")
IndexData.LOGGER.info("Indexing data")
helpers.bulk(self.es, self.output, index=self.index)
out = json.dumps(self.es.cluster.health(wait_for_status='yellow', request_timeout=1), indent=4)
IndexData.LOGGER.info(out)
IndexData.LOGGER.debug(out)
IndexData.LOGGER.info("The data have been successfully indexed")
1 change: 1 addition & 0 deletions deps/wazuh_testing/wazuh_testing/scripts/qa_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@ def parse_data(args):

# Parse a list of test modules
if args.test_modules:
qadocs_logger.info(f"Parsing the following test(s) modules(s): {args.test_modules}")
docs = DocGenerator(Config(SCHEMA_PATH, args.tests_path, OUTPUT_PATH, args.test_types,
args.test_modules), OUTPUT_FORMAT)
else:
Expand Down

0 comments on commit ce73ed5

Please sign in to comment.