1 /* 2 * Copyright (C) 2020 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package com.android.tradefed.result.error; 17 18 import com.android.tradefed.result.proto.TestRecordProto.FailureStatus; 19 20 /** Error Identifiers from Trade Federation infra, and dependent infra (like Build infra). */ 21 public enum InfraErrorIdentifier implements ErrorIdentifier { 22 23 // ******************************************************************************************** 24 // Infra: 10_001 ~ 20_000 25 // ******************************************************************************************** 26 // 10_001 - 10_500: General errors 27 ARTIFACT_NOT_FOUND(10_001, FailureStatus.INFRA_FAILURE), 28 FAIL_TO_CREATE_FILE(10_002, FailureStatus.INFRA_FAILURE), 29 INVOCATION_CANCELLED(10_003, FailureStatus.CANCELLED), 30 31 // 10_501 - 11_000: Build, Artifacts download related errors 32 ARTIFACT_REMOTE_PATH_NULL(10_501, FailureStatus.INFRA_FAILURE), 33 ARTIFACT_UNSUPPORTED_PATH(10_502, FailureStatus.INFRA_FAILURE), 34 ARTIFACT_DOWNLOAD_ERROR(10_503, FailureStatus.INFRA_FAILURE), 35 36 // 11_001 - 11_500: environment issues: For example: lab wifi 37 WIFI_FAILED_CONNECT(11_001, FailureStatus.UNSET), // TODO: switch to dependency_issue 38 39 // 12_000 - 12_100: Test issues detected by infra 40 EXPECTED_TESTS_MISMATCH(12_000, FailureStatus.TEST_FAILURE), 41 42 UNDETERMINED(20_000, FailureStatus.UNSET); 43 44 private final long code; 45 private final FailureStatus status; 46 InfraErrorIdentifier(int code, FailureStatus status)47 InfraErrorIdentifier(int code, FailureStatus status) { 48 this.code = code; 49 this.status = status; 50 } 51 52 @Override code()53 public long code() { 54 return code; 55 } 56 57 @Override status()58 public FailureStatus status() { 59 return status; 60 } 61 } 62