Current Conditions for using exceptions: | Package Validation Suite | 0.16.0-preview
docs.unity3d.com
    Show / Hide Table of Contents

    Unity is a complex and highly customizable engine, and in some cases, the validation suite will flag errors incorrectly. While the Package Manager Infrastructure team fixes these issues, a mechanism exists to temporarily get your package validated.

    Current Conditions for using exceptions:

    • The Package Manager Infrastructure team has been notified about the failure.
    • The Exception file is shipped with the package, for tracking purposes.
    • For now, only some validations accept exceptions:
      • API Validation
      • Updater Configuration Validation
      • Restricted File Type Validation

    Steps to include a validation exception:

    1. Create a file called "ValidationExceptions.json" at the root of your package.
    2. Make sure to generate the associated .meta file by opening the package in an editor.
    3. Include content as specified below:
      • ValidationTest - Display Name of the test in which the exception is requested, as seen in the report generated byt he Validation Suite.
      • ExceptionError - Full error string for which the exception is requested. Do not include the initial "Error: " string.
      • PackageVersion - Version of the package for which this exception is requested. This mechanism is to insight you to revisit exceptions on every version of the package, and find ways to remove them, by working through issues with the package infrastructure team.

    ValidationExceptions.json file format

    {
        "Exceptions":
        [
            {
                 "ValidationTest": "API Validation",
                 "ExceptionError": "Error without the words Error: at the begining",
                 "PackageVersion": "0.8.2-preview"
           }
        ]
    }
    

    Test Level Exception

    In some rare cases, due to the nature or number of errors in a given test, a complete test might need to be exceptioned. To do so, simply remove the ExceptionError field, and all errors found in the given test will be exceptioned.

    {
        "Exceptions":
        [
            {
                 "ValidationTest": "API Validation",
                 "ExceptionError": "",
                 "PackageVersion": "0.8.2-preview"
           }
        ]
    }
    

    Example:

    if the Validation Suite report is:

    Validation Suite Results for package "com.unity.my-package"
     - Path: /path/to/com.unity.my-package
     - Version: 4.5.6
     - Context: LocalDevelopmentInternal
     - Lifecycle: 1
     - Test Time: 2020-05-22 9:25:22 AM
     - Tested with com.unity.package-validation-suite version: 0.10.0-preview
    
    VALIDATION RESULTS:
    ------------------
    
    Failed - "API Validation"
        Error: There was an error with the API Validation.
    
    Failed - "Restricted File Type Validation"
        Error: /csc.rsp cannot be included in a package.
    
    Succeeded - "Assembly Definition Validation"
    
    Succeeded - "ChangeLog Validation"
    
    Succeeded - "Package Diff Evaluation"
     [...]
    

    and you would like to make an exception for a specific Restricted File Type Validation and for all of the API Validation errors in your package's version 4.5.6, then the ValidationExceptions.json file would contain:

    {
        "Exceptions":
        [
            {
                 "ValidationTest": "API Validation",
                 "ExceptionError": "",
                 "PackageVersion": "4.5.6"
           },
           {
                  "ValidationTest": "Restricted File Type Validation",
                  "ExceptionError": "/csc.rsp cannot be included in a package.",
                  "PackageVersion": "4.5.6"
           }
        ]
    }
    
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023