Skip to content

Commit

Permalink
Remove unused Test Execution Review mentions
Browse files Browse the repository at this point in the history
  • Loading branch information
omar-selo committed Oct 16, 2024
1 parent 3e158d5 commit 5050737
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 100 deletions.
69 changes: 0 additions & 69 deletions frontend/lib/models/test_execution.dart
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,6 @@ class TestExecution with _$TestExecution {

factory TestExecution.fromJson(Map<String, Object?> json) =>
_$TestExecutionFromJson(json);

static Object updateReviewDecisionRequestData(
String reviewComment,
List<TestExecutionReviewDecision> reviewDecision,
) {
return {
reviewCommentJsonKey: reviewComment,
reviewDecisionJsonKey: reviewDecision,
};
}
}

enum TestExecutionStatus {
Expand Down Expand Up @@ -120,62 +110,3 @@ enum TestExecutionStatus {
}
}
}

enum TestExecutionReviewDecision {
@JsonValue('REJECTED')
rejected,
@JsonValue('APPROVED_INCONSISTENT_TEST')
approvedInconsistentTest,
@JsonValue('APPROVED_UNSTABLE_PHYSICAL_INFRA')
approvedUnstablePhysicalInfra,
@JsonValue('APPROVED_CUSTOMER_PREREQUISITE_FAIL')
approvedCustomerPrerequisiteFail,
@JsonValue('APPROVED_FAULTY_HARDWARE')
approvedFaultyHardware,
@JsonValue('APPROVED_ALL_TESTS_PASS')
approvedAllTestsPass;

String get name {
switch (this) {
case rejected:
return 'Reject';
case approvedInconsistentTest:
return 'Approve (inconsistent test definition)';
case approvedUnstablePhysicalInfra:
return 'Approve (unstable physical infrastructure)';
case approvedCustomerPrerequisiteFail:
return 'Approve (customer provided prerequisite failing)';
case approvedFaultyHardware:
return 'Approve (faulty hardware)';
case approvedAllTestsPass:
return 'Approve (all tests pass)';
}
}

bool get isDeprecated {
switch (this) {
case approvedFaultyHardware:
case approvedUnstablePhysicalInfra:
return true;
default:
return false;
}
}

String toJson() {
switch (this) {
case rejected:
return 'REJECTED';
case approvedInconsistentTest:
return 'APPROVED_INCONSISTENT_TEST';
case approvedUnstablePhysicalInfra:
return 'APPROVED_UNSTABLE_PHYSICAL_INFRA';
case approvedCustomerPrerequisiteFail:
return 'APPROVED_CUSTOMER_PREREQUISITE_FAIL';
case approvedFaultyHardware:
return 'APPROVED_FAULTY_HARDWARE';
case approvedAllTestsPass:
return 'APPROVED_ALL_TESTS_PASS';
}
}
}
15 changes: 0 additions & 15 deletions frontend/lib/providers/artefact_builds.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,6 @@ class ArtefactBuilds extends _$ArtefactBuilds {
return await api.getArtefactBuilds(artefactId);
}

Future<void> changeReviewDecision(
int testExecutionId,
String reviewComment,
List<TestExecutionReviewDecision> reviewDecision,
) async {
final api = ref.read(apiProvider);
final testExecution = await api.changeTestExecutionReview(
testExecutionId,
reviewDecision,
reviewComment,
);

await _updateTestExecutions({testExecutionId}, (_) => testExecution);
}

Future<void> rerunTestExecutions(Set<int> testExecutionIds) async {
final api = ref.read(apiProvider);
final rerunRequests = await api.rerunTestExecutions(testExecutionIds);
Expand Down
16 changes: 0 additions & 16 deletions frontend/lib/repositories/api_repository.dart
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import '../models/environment_issue.dart';
import '../models/environment_review.dart';
import '../models/family_name.dart';
import '../models/rerun_request.dart';
import '../models/test_execution.dart';
import '../models/test_issue.dart';
import '../models/test_result.dart';
import '../models/test_event.dart';
Expand Down Expand Up @@ -47,21 +46,6 @@ class ApiRepository {
return artefactBuilds;
}

Future<TestExecution> changeTestExecutionReview(
int testExecutionId,
List<TestExecutionReviewDecision> reviewDecision,
String reviewComment,
) async {
final response = await dio.patch(
'/v1/test-executions/$testExecutionId',
data: TestExecution.updateReviewDecisionRequestData(
reviewComment,
reviewDecision,
),
);
return TestExecution.fromJson(response.data);
}

Future<List<TestResult>> getTestExecutionResults(int testExecutionId) async {
final response =
await dio.get('/v1/test-executions/$testExecutionId/test-results');
Expand Down

0 comments on commit 5050737

Please sign in to comment.