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 30 // 10_501 - 11_000: Build, Artifacts download related errors 31 ARTIFACT_REMOTE_PATH_NULL(10_501, FailureStatus.INFRA_FAILURE), 32 ARTIFACT_UNSUPPORTED_PATH(10_502, FailureStatus.INFRA_FAILURE), 33 ARTIFACT_DOWNLOAD_ERROR(10_503, FailureStatus.INFRA_FAILURE), 34 35 // 11_001 - 11_500: environment issues: For example: lab wifi 36 WIFI_FAILED_CONNECT(11_001, FailureStatus.UNSET), // TODO: switch to dependency_issue 37 38 // 12_000 - 12_100: Test issues detected by infra 39 EXPECTED_TESTS_MISMATCH(12_000, FailureStatus.TEST_FAILURE), 40 41 UNDETERMINED(20_000, FailureStatus.UNSET); 42 43 private final long code; 44 private final FailureStatus status; 45 InfraErrorIdentifier(int code, FailureStatus status)46 InfraErrorIdentifier(int code, FailureStatus status) { 47 this.code = code; 48 this.status = status; 49 } 50 51 @Override code()52 public long code() { 53 return code; 54 } 55 56 @Override status()57 public FailureStatus status() { 58 return status; 59 } 60 } 61