New issue
Advanced search Search tips

Issue 903717 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Nov 14
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 3
Type: Feature



Sign in to add a comment

factory: use exceptions defined in utils/ for JSONSchemaDict

Project Member Reported by fshao@chromium.org, Nov 9

Issue description

For now, JSONSchemaDict in utils/schema.py uses jsonschema package for validation which raises its own built-in exceptions.  These are inconsistent with factory-defined ones, and may cause some inconvenience when writing unit tests or debugging.  Maybe we should do some changes for better consistency.
 
Labels: OS-Chrome
Project Member

Comment 2 by bugdroid1@chromium.org, Nov 13

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform/factory/+/186d25b30bdf73f4cef0a985af768e6d4371131a

commit 186d25b30bdf73f4cef0a985af768e6d4371131a
Author: Fei Shao <fshao@google.com>
Date: Tue Nov 13 16:22:53 2018

utils/schema: Change exception type of JSONSchemaDict

JSONSchemaDict in utils/schema.py uses jsonschema package for schema
validation, and raises exception defined in that package.  Those
exceptions are not consistent with ones we defined in utils/, and may
cause confusion or difficulties writing unit tests.

This CL made a modification to intercept and replace them with our own
exception, which should provide better consistency.

BUG= chromium:903717 
TEST=./setup/cros_docker.sh umpire test
TEST=make test

Change-Id: I16153a06ab649e352d51f35c8ef2bb6e6f7d3a23
Reviewed-on: https://chromium-review.googlesource.com/1328407
Commit-Ready: Youcheng Syu <youcheng@chromium.org>
Tested-by: Fei Shao <fshao@chromium.org>
Reviewed-by: Pi-Hsun Shih <pihsun@chromium.org>
Reviewed-by: Youcheng Syu <youcheng@chromium.org>

[modify] https://crrev.com/186d25b30bdf73f4cef0a985af768e6d4371131a/py/utils/schema.py

Status: Fixed (was: Assigned)

Sign in to add a comment