Skip to content
This repository was archived by the owner on Nov 24, 2025. It is now read-only.

Conversation

@ocket8888
Copy link
Contributor

What this PR is primarily meant to do is make keeping parity between API services and their mock testing services easier for developers. It does this by, for each API service, ensuring it is implemented by the corresponding mock/testing service. For example, with the API service:

export class FooService extends APIService {
	//...
}

in experimental/traffic-portal/src/app/api, this PR ensures there is a corresponding service in experimental/traffic-portal/src/app/api/testing such that:

import { FooService as ConcreteFooService } from "../foo.service.ts";

export class FooService implements ConcreteFooService {
	//...
}

This means that adding functionality to the "concrete" service that isn't being properly mocked will result in testing compilation errors.

In order to ensure the services are working properly, this PR also adds 100% test coverage to experimental/traffic-portal/src/app/api/testing and fills any gaps in testing coverage for experimental/traffic-portal/src/app/api.


Which Traffic Control components are affected by this PR?

  • Traffic Portal (experimental v2)

What is the best way to verify this PR?

Make sure the provided tests pass.

PR submission checklist

  • This PR has tests
  • This PR doesn't need documentation
  • This PR doesn't need a CHANGELOG.md entry
  • This PR DOES NOT FIX A SERIOUS SECURITY VULNERABILITY

@ocket8888 ocket8888 added low impact affects only a small portion of a CDN, and cannot itself break one tests related to tests and/or testing infrastructure improvement The functionality exists but it could be improved in some way. experimental a feature/component not directly supported by ATC Traffic Portal v2 Related to the experimental Traffic Portal version 2 labels Jun 26, 2023
@codecov
Copy link

codecov bot commented Jun 26, 2023

Codecov Report

❌ Patch coverage is 99.51456% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 69.60%. Comparing base (9cfe018) to head (1fed230).
⚠️ Report is 227 commits behind head on master.

Files with missing lines Patch % Lines
...tatuses/status-details/status-details.component.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             master    #7599       +/-   ##
=============================================
+ Coverage     31.83%   69.60%   +37.76%     
  Complexity       98       98               
=============================================
  Files           717      324      -393     
  Lines         82720    12865    -69855     
  Branches        965      974        +9     
=============================================
- Hits          26338     8955    -17383     
+ Misses        54217     3574    -50643     
+ Partials       2165      336     -1829     
Flag Coverage Δ
golib_unit ?
grove_unit ?
t3c_unit ?
traffic_monitor_unit ?
traffic_ops_unit ?
traffic_portal_v2 83.78% <99.51%> (+9.38%) ⬆️
traffic_stats_unit ?
unit_tests 83.78% <99.51%> (+54.61%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ocket8888 ocket8888 requested a review from shamrickus June 26, 2023 19:39
That was the only way I could implement the abstract class without
extending it.
allowed creation of regions in non-existent divisions, wouldn't delete
things by object as well as ID, etc. Also added 100% test coverage.
Also added 100% test coverage
Some were accepting IDs but not response structures. Also added 100%
test coverage.
Used to only work on Ids. Also added 100% test coverage.
Also fixed some bugs in the testing server service and added 100% test
coverage.
@ocket8888 ocket8888 force-pushed the tpv2/api-testing-implementation branch from e00087c to 1fed230 Compare September 21, 2023 21:37
@ocket8888 ocket8888 requested review from shamrickus and removed request for shamrickus September 22, 2023 02:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

experimental a feature/component not directly supported by ATC improvement The functionality exists but it could be improved in some way. low impact affects only a small portion of a CDN, and cannot itself break one tests related to tests and/or testing infrastructure Traffic Portal v2 Related to the experimental Traffic Portal version 2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant