From 552e0c8162af8d4cf182789bfbb686bcce644c72 Mon Sep 17 00:00:00 2001 From: AJ Bahnken <1144310+ajvb@users.noreply.github.com> Date: Tue, 24 Sep 2019 13:33:57 -0700 Subject: [PATCH] Complete renaming to 'frost' (#293) --- Makefile | 4 ++-- README.md | 28 ++++++++++++++-------------- bin/auth/setup_gsuite.py | 2 +- config.yaml.example | 2 +- gsuite/client.py | 2 +- service_report_generator.py | 6 +++--- setup.py | 2 +- 7 files changed, 23 insertions(+), 23 deletions(-) diff --git a/Makefile b/Makefile index 92f4865..8140135 100644 --- a/Makefile +++ b/Makefile @@ -17,11 +17,11 @@ awsci: check_venv check_venv: ifeq ($(VIRTUAL_ENV),) - $(error "Run pytest-services from a virtualenv (try 'make install && source venv/bin/activate')") + $(error "Run frost from a virtualenv (try 'make install && source venv/bin/activate')") endif check_conftest_imports: - # refs: https://github.com/mozilla-services/pytest-services/issues/119 + # refs: https://github.com/mozilla/frost/issues/119 rg '^import\s+conftest|^from\s+conftest\s+import\s+pytest' -g '*.py'; [ $$? -eq 1 ] clean: clean-cache clean-python diff --git a/README.md b/README.md index a28ee35..ba53dba 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ The options include pytest options: * [`-m`](https://docs.pytest.org/en/latest/example/markers.html#marking-test-functions-and-selecting-them-for-a-run) not used but the marker filter can be useful for selecting all tests for specific services (e.g. `-m rds`) * [`-s`](https://docs.pytest.org/en/latest/capture.html) to disable capturing stdout so we can see the progress fetching AWS resources -and options pytest-services adds: +and options frost adds: * `--debug-calls` for printing (with `-s`) API calls we make * `--aws-profiles` for selecting one or more AWS profiles to fetch resources for or the AWS default profile / `AWS_PROFILE` environment variable @@ -71,7 +71,7 @@ and produces output like the following showing a DB instance with backups disabl platform darwin -- Python 3.6.2, pytest-3.3.2, py-1.5.2, pluggy-0.6.0 metadata: {'Python': '3.6.2', 'Platform': 'Darwin-15.6.0-x86_64-i386-64bit', 'Packages': {'pytest': '3.3.2', 'py': '1.5.2', 'pluggy': '0.6. 0'}, 'Plugins': {'metadata': '1.5.1', 'json': '0.4.0', 'html': '1.16.1'}} -rootdir: /Users/gguthe/mozilla-services/pytest-services, inifile: +rootdir: /Users/gguthe/mozilla/frost, inifile: plugins: metadata-1.5.1, json-0.4.0, html-1.16.1 collecting 0 items c alling AWSAPICall(profile='default', region='us-west-2', service='rds', method='describe_db_instances', args=[], kwargs={}) @@ -100,9 +100,9 @@ aws/rds/test_rds_db_instance_backup_enabled.py:12: AssertionError ============================================ 1 failed, 3 passed, 72 deselected in 3.12 seconds ============================================ ``` -#### IAM Policy for pytest-services +#### IAM Policy for frost -The below policy will allow you to run all AWS tests in pytest-services against all resources in your account. +The below policy will allow you to run all AWS tests in frost against all resources in your account. ```json { @@ -201,7 +201,7 @@ These files can be removed individually or all at once with [the pytest --cache- ## Custom Test Config -pytest-services adds a `--config` cli option for passing in a custom config file specific to tests within pytest-services. +frost adds a `--config` cli option for passing in a custom config file specific to tests within frost. The example config in repo (`config.yaml.example`): ``` @@ -266,7 +266,7 @@ pagerduty: ### Test Exemptions -pytest-services custom config format adds support for +frost custom config format adds support for marking test and test resource IDs as expected failures. The keys for each exemption rule is: @@ -341,7 +341,7 @@ python -m json.tool report.json | grep -C 20 xfail #### Test Severity -pytest-services custom config format adds support for marking the severity of a certain test. A severity can be `INFO`, `WARN`, or `ERROR`. +frost custom config format adds support for marking the severity of a certain test. A severity can be `INFO`, `WARN`, or `ERROR`. These do not modify pytest results (pass, fail, xfail, skip, etc.). @@ -398,7 +398,7 @@ python -m json.tool report.json ### Test Regressions -pytest-services custom config format adds support for marking specific tests on specific resources as regressions. +frost custom config format adds support for marking specific tests on specific resources as regressions. As with `severity` this does not modify the pytest results, but rather adds a marker that can be used when analyzing the results. The config looks like: @@ -413,7 +413,7 @@ regressions: ### AWS Config -pytest-services has a suite of AWS tests. This section of the custom config includes configuration options specific +frost has a suite of AWS tests. This section of the custom config includes configuration options specific to these tests. The config looks like: @@ -453,7 +453,7 @@ aws: ### GSuite Config -pytest-services has a suite of GSuite tests. This section of the +frost has a suite of GSuite tests. This section of the custom config includes configuration options specific to these tests. **Make sure to [setup GSuite](#setting-up-gsuite-tests) before running GSuite tests** @@ -473,7 +473,7 @@ gsuite: ### Pagerduty Config -pytest-services does not query the pagerduty API, but can run tests against output from it. +frost does not query the pagerduty API, but can run tests against output from it. The config looks like: ``` @@ -542,7 +542,7 @@ The files have examples formats as follows: ### Test Accuracy -There are two important things to note about `pytest-services` tests that may be different from your expectations. +There are two important things to note about `frost` tests that may be different from your expectations. First, the focus is on "actionable results". This plays out as an attempt to reduce false positives by trying to filter out unused resources. An example of this can be seen by looking at @@ -600,7 +600,7 @@ Additionally we want: #### File Layout ```console -pytest-services +frost ... ├── example_cache │   └── v @@ -691,7 +691,7 @@ Notes: pytest --ignore aws/ platform darwin -- Python 3.6.2, pytest-3.3.2, py-1.5.2, pluggy-0.6.0 metadata: {'Python': '3.6.2', 'Platform': 'Darwin-15.6.0-x86_64-i386-64bit', 'Packages': {'pytest': '3.3.2', 'py': '1.5.2', 'pluggy': '0.6.0'}, 'Plugins': {'metadata': '1.5.1', 'json': '0.4.0', 'html': '1.16.1'}} -rootdir: /Users/gguthe/mozilla-services/pytest-services, inifile: +rootdir: /Users/gguthe/mozilla/frost, inifile: plugins: metadata-1.5.1, json-0.4.0, html-1.16.1 collected 3 items diff --git a/bin/auth/setup_gsuite.py b/bin/auth/setup_gsuite.py index 3fb5e2b..f61cb4f 100644 --- a/bin/auth/setup_gsuite.py +++ b/bin/auth/setup_gsuite.py @@ -12,7 +12,7 @@ from oauth2client import tools from oauth2client.file import Storage -APPLICATION_NAME = "pytest-services" +APPLICATION_NAME = "frost" def get_client_secret_file(): diff --git a/config.yaml.example b/config.yaml.example index 2b653b0..0c67bfc 100644 --- a/config.yaml.example +++ b/config.yaml.example @@ -1,5 +1,5 @@ # -# pytest-services config file +# frost config file # # Documentation on config file found in README.md # diff --git a/gsuite/client.py b/gsuite/client.py index d02b11b..e789b81 100644 --- a/gsuite/client.py +++ b/gsuite/client.py @@ -4,7 +4,7 @@ from apiclient import discovery from oauth2client.file import Storage -CREDS_NAME = "pytest-services-gsuite-readonly" +CREDS_NAME = "frost-gsuite-readonly" SCOPES = [ "https://www.googleapis.com/auth/admin.directory.user.readonly", "https://www.googleapis.com/auth/admin.directory.group.readonly", diff --git a/service_report_generator.py b/service_report_generator.py index 4429318..7c88730 100644 --- a/service_report_generator.py +++ b/service_report_generator.py @@ -5,7 +5,7 @@ { 'name': 'pytest', - 'tool_url': 'https://github.com/mozilla-services/pytest-services', + 'tool_url': 'https://github.com/mozilla/frost', 'version': 1, 'created_at': '2000-01-01 15:50:00.123123', 'meanings': { @@ -55,7 +55,7 @@ service_json_template = { "name": "pytest", - "tool_url": "https://github.com/mozilla-services/pytest-services", + "tool_url": "https://github.com/mozilla/frost", "version": 1, "created_at": "", "meanings": { @@ -218,7 +218,7 @@ def _print_test_result_csv(self, test_name): class MarkdownReportGenerator(ReportGenerator): def print_header(self): - print("# AWS pytest-services results\n", file=self.fout) + print("# AWS frost results\n", file=self.fout) print("#### Status Meanings: \n", file=self.fout) self._print_status_table() diff --git a/setup.py b/setup.py index e87142e..37cf1ab 100644 --- a/setup.py +++ b/setup.py @@ -11,7 +11,7 @@ description="tests for checking that third party services the Firefox Operations Security or foxsec team uses are configured correctly", long_description=long_description, long_description_content_type="text/markdown", - url="https://github.com/mozilla-services/pytest-services", + url="https://github.com/mozilla/frost", license="MPL2", packages=setuptools.find_packages(), classifiers=[