コード例 #1
0
 def test_config_is_sorted(self):
     """Test jobs/config.json, prow/config.yaml and boskos/resources.json are sorted."""
     with open(config_sort.test_infra('jobs/config.json')) as fp:
         original = fp.read()
         expect = config_sort.sorted_job_config().getvalue()
         if original != expect:
             self.fail('jobs/config.json is not sorted, please run '
                       '`bazel run //jobs:config_sort`')
     with open(config_sort.test_infra('prow/config.yaml')) as fp:
         original = fp.read()
         expect = config_sort.sorted_prow_config().getvalue()
         if original != expect:
             self.fail('prow/config.yaml is not sorted, please run '
                       '`bazel run //jobs:config_sort`')
     with open(config_sort.test_infra('boskos/resources.json')) as fp:
         original = fp.read()
         expect = config_sort.sorted_boskos_config().getvalue()
         if original != expect:
             self.fail('boskos/resources.json is not sorted, please run '
                       '`bazel run //jobs:config_sort`')
コード例 #2
0
 def test_config_is_sorted(self):
     """Test jobs/config.json, prow/config.yaml and boskos/resources.json are sorted."""
     with open(config_sort.test_infra('jobs/config.json')) as fp:
         original = fp.read()
         expect = config_sort.sorted_job_config().getvalue()
         if original != expect:
             self.fail('jobs/config.json is not sorted, please run '
                       '`bazel run //jobs:config_sort`')
     with open(config_sort.test_infra('prow/config.yaml')) as fp:
         original = fp.read()
         expect = config_sort.sorted_prow_config().getvalue()
         if original != expect:
             self.fail('prow/config.yaml is not sorted, please run '
                       '`bazel run //jobs:config_sort`')
     with open(config_sort.test_infra('boskos/resources.json')) as fp:
         original = fp.read()
         expect = config_sort.sorted_boskos_config().getvalue()
         if original != expect:
             self.fail('boskos/resources.json is not sorted, please run '
                       '`bazel run //jobs:config_sort`')