Skip to content

Commit 8854590

Browse files
Collect k8s coverage data and include them in coverage JSON files
1 parent c286384 commit 8854590

File tree

3 files changed

+54
-5
lines changed

3 files changed

+54
-5
lines changed

.github/workflows/docs-parity-updates.yml

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ jobs:
7272
ARTIFACT_ID: parity-metric-pro-raw-amd*
7373
WORKFLOW: "AWS / Build, Test, Push"
7474
PREFIX_ARTIFACT: pro-integration-test
75-
75+
7676
- name: Download coverage (capture-notimplemented) data from Pro pipeline (GitHub)
7777
working-directory: docs
7878
run: /tmp/get_latest_github_metrics.sh ./target main
@@ -103,6 +103,36 @@ jobs:
103103
WORKFLOW: "AWS / Build, Test, Push"
104104
RESOURCE_FOLDER: "metrics-implementation-details/community"
105105

106+
- name: Download coverage data for K8s pipeline (acceptance tests) (GitHub)
107+
working-directory: docs
108+
run: /tmp/get_latest_github_metrics.sh ./target main
109+
env:
110+
GITHUB_TOKEN: ${{ secrets.PRO_ACCESS_TOKEN }}
111+
REPOSITORY_NAME: localstack-pro
112+
ARTIFACT_ID: parity-metric-pro-k8s-acceptance-raw-amd64-*
113+
WORKFLOW: "AWS / Pro K8s tests"
114+
PREFIX_ARTIFACT: k8s-acceptance-test
115+
116+
- name: Download coverage data for K8s pipeline (integration tests) (GitHub)
117+
working-directory: docs
118+
run: /tmp/get_latest_github_metrics.sh ./target main
119+
env:
120+
GITHUB_TOKEN: ${{ secrets.PRO_ACCESS_TOKEN }}
121+
REPOSITORY_NAME: localstack-pro
122+
ARTIFACT_ID: parity-metric-pro-k8s-integration-raw-amd64-*
123+
WORKFLOW: "AWS / Pro K8s tests"
124+
PREFIX_ARTIFACT: k8s-integration-test
125+
126+
- name: Download coverage data for community K8s pipeline (integration tests) (GitHub)
127+
working-directory: docs
128+
run: /tmp/get_latest_github_metrics.sh ./target main
129+
env:
130+
GITHUB_TOKEN: ${{ secrets.PRO_ACCESS_TOKEN }}
131+
REPOSITORY_NAME: localstack-pro
132+
ARTIFACT_ID: parity-metric-community-k8s-integration-raw-*
133+
WORKFLOW: "AWS / Community K8S tests"
134+
PREFIX_ARTIFACT: k8s-community-integration-test
135+
106136
- name: Create Parity Coverage Docs
107137
working-directory: docs
108138
run: |

scripts/create_data_coverage.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ def _init_metric_recorder(operations_dict: dict):
167167
"aws_validated": False,
168168
"snapshot_tested": False,
169169
"snapshot_skipped": "",
170+
"k8s_test_suite": False,
170171
}
171172
operations[operation] = op_attributes
172173

@@ -221,17 +222,17 @@ def aggregate_recorded_raw_data(
221222
pathlist = Path(base_dir).rglob("*.csv")
222223
for path in pathlist:
223224
test_source = path.stem
224-
# print(f"checking {str(path)}")
225225
with open(path, "r") as csv_obj:
226226
csv_dict_reader = csv.DictReader(csv_obj)
227227
for metric in csv_dict_reader:
228228
service = metric.get("service")
229229
if service not in services_of_interest:
230230
continue
231-
232-
node_id = metric.get("node_id") or metric.get("test_node_id")
233-
if not node_id:
231+
232+
node_id = metric.get("node_id") or metric.get("test_node_id") or ""
233+
if not node_id and not test_source.startswith("k8s"):
234234
# some records do not have a node-id -> relates to requests in the background between tests
235+
# For K8s tests we do not have a node_id, so we keep those records
235236
continue
236237

237238
# skip tests are marked as xfail
@@ -250,6 +251,7 @@ def aggregate_recorded_raw_data(
250251

251252
internal_test = False
252253
external_test = False
254+
k8s_tested = False
253255

254256
if test_source.startswith("community"):
255257
test_node_origin = "LocalStack Community"
@@ -259,6 +261,11 @@ def aggregate_recorded_raw_data(
259261
test_node_origin = "LocalStack Pro"
260262
internal_test = True
261263
source = "ls_pro"
264+
elif test_source.startswith("k8s"):
265+
internal_test = True
266+
k8s_tested = True
267+
source = "ls_pro" # for now k8s tests are only running in pro
268+
test_node_origin = "LocalStack Pro"
262269
else:
263270
external_test = True
264271

@@ -274,6 +281,8 @@ def aggregate_recorded_raw_data(
274281
op_record["internal_test_suite"] = True
275282
if external_test and not op_record.get("external_test_suite"):
276283
op_record["external_test_suite"] = True
284+
if k8s_tested and not op_record.get("k8s_test_suite"):
285+
op_record["k8s_test_suite"] = True
277286

278287
aws_validated = (
279288
str(metric.get("aws_validated", "false")).lower() == "true"

src/components/feature-coverage/FeatureCoverage.tsx

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,14 @@ const columns: ColumnDef<any>[] = [
5252
enableSorting: false,
5353
enableResizing: false,
5454
},
55+
{
56+
id: 'k8s_support',
57+
accessorFn: (row) => row[Object.keys(row)[0]].k8s_test_suite,
58+
header: () => 'Kubernetes Support',
59+
cell: ({ getValue }) => (getValue() ? '✔️' : ''),
60+
enableSorting: false,
61+
enableResizing: false,
62+
},
5563
];
5664

5765
export default function PersistenceCoverage({ service }: { service: string }) {
@@ -137,6 +145,8 @@ export default function PersistenceCoverage({ service }: { service: string }) {
137145
return '15%';
138146
case 'image':
139147
return '15%';
148+
case 'k8s_support':
149+
return '15%';
140150
default:
141151
return '15%';
142152
}

0 commit comments

Comments
 (0)