tree: 7e44a7fa2ff484f51681e673386e175f096b78c0 [path history] [tgz]
  1. test_data/
  2. annotation_tokenizer.py
  3. annotation_tokenizer_test.py
  4. annotation_tools.py
  5. auditor.py
  6. auditor.py.vpython
  7. auditor_tests.py
  8. check_annotations.py
  9. extractor.py
  10. extractor_test.py
  11. generator_utils.py
  12. generator_utils_tests.py
  13. README.md
  14. traffic_annotation_auditor_tests.py
  15. update_annotations_doc.py
  16. update_annotations_doc.py.vpython
  17. update_annotations_doc_tests.py
  18. update_annotations_sheet.py
  19. update_annotations_sheet.py.vpython
tools/traffic_annotation/scripts/README.md

Traffic Annotation Scripts

This file describes the scripts in tools/traffic_annotation/scripts.

check_annotations.py

Runs traffic annotation tests on the changed files or all repository. The tests are run in error resilient mode. Requires a compiled build directory to run.

traffic_annotation_auditor_tests.py

Runs tests to ensure traffic_annotation_auditor is performing as expected. Tests include:

  • Checking if auditor and underlying extractor run, and an expected minimum number of outputs are returned.
  • Checking if enabling or disabling heuristics that make tests faster has any effect on the output.
  • Checking if running on the whole repository (instead of only changed files) would result in any error. This test may take a few hours to run and requires a compiled build directory.

annotation_tools.py

Provides tools for annotation test scripts.

update_annotations_sheet.py

This script updates the Google sheet that presents all network traffic annotations.

extractor.py

Scans through a set of specified C++ files to detect existing traffic annotations in code. It uses regex expressions on source files.

extractor_test.py

Unit tests for extractor.py.

update_annotations_doc.py

Updates the Chrome Browser Network Traffic Annotations document that presents all network traffic annotations specified within summary/grouping.xml.

  • You can use the hidden="true" attribute within a group to suppress the group and its nested senders and annotations from appearing in the document.
  • You can use the hidden="true" attribute within the annotations in grouping.xml to suppress them from appearing in the document.
  • grouping.xml needn't be organized in alphabetical order, the script automatically places them in alphabetical order.

update_annotations_doc_tests.py

Unit tests for update_annotations_doc.py.

generator_utils.py

Parses the grouping.xml and annotations.tsv files to provide update_annotations_doc.py with the annotations and their relevant information, e.g. unique_id, data, trigger, etc. Also includes methods to parse the json object returned by the Google Docs API get() method.

generator_utils_tests.py

Unit tests for generator_utils.py.