Skip to content

Commit 3c80343

Browse files
committed
update: repos and scripts upon frontend refactor
Due to the frontend refactor in frontend PR #763, there was a need to update playwright tests and the accompanied repositories and the script that are used for local playwright tests. Use make repos-initial instead of the previous make repos-minimal. A new script which counts the duration how long it takes to import and snapshot or introspect the required repos for testing has been added.
1 parent cee2333 commit 3c80343

4 files changed

Lines changed: 61 additions & 5 deletions

File tree

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ If you want less Red Hat repos:
7070
OPTIONS_REPOSITORY_IMPORT_FILTER=small make repos-import
7171
```
7272

73-
This will import and snapshot repos needed for the minimal viable environment. Useful for running Playwright tests.
73+
This will import and snapshot repos needed for the initial viable environment required before running Playwright tests.
7474

7575
```sh
76-
make repos-minimal
76+
make repos-initial
7777
```
7878

7979
### Run the server!

mk/repos.mk

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,13 @@ repos-minimal: ## Import and snapshot repos needed for a minimal setup, usefull
2424
OPTIONS_REPOSITORY_IMPORT_FILTER=small go run ./cmd/external-repos/main.go import
2525
go run cmd/external-repos/main.go snapshot --url https://cdn.redhat.com/content/dist/rhel9/9/aarch64/codeready-builder/os/ --force
2626
OPTIONS_REPOSITORY_IMPORT_FILTER=epel10 go run ./cmd/external-repos/main.go import
27+
go run cmd/external-repos/main.go snapshot --url https://dl.fedoraproject.org/pub/epel/10/Everything/x86_64/ --force
28+
29+
.PHONY: repos-initial
30+
repos-initial: ## Import and snapshot or introspect repos needed before running Playwright tests, the repos used: HARDCODED + EPEL10
31+
OPTIONS_REPOSITORY_IMPORT_FILTER=hardcoded go run ./cmd/external-repos/main.go import
32+
go run cmd/external-repos/main.go snapshot --url https://cdn.redhat.com/content/dist/rhel10/10/aarch64/appstream/os/ --force
33+
OPTIONS_REPOSITORY_IMPORT_FILTER=hardcoded go run ./cmd/external-repos/main.go import
34+
go run cmd/external-repos/main.go snapshot --url https://cdn.redhat.com/content/dist/rhel10/10/aarch64/baseos/os/ --force
35+
OPTIONS_REPOSITORY_IMPORT_FILTER=epel10 go run ./cmd/external-repos/main.go import
2736
go run cmd/external-repos/main.go introspect --url https://dl.fedoraproject.org/pub/epel/10/Everything/x86_64/ --force

pkg/external_repos/snapshotted_repos/rhel10-aarch64.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"url": "https://cdn.redhat.com/content/dist/rhel10/10/aarch64/baseos/os",
66
"distribution_arch": "aarch64",
77
"distribution_version": "10",
8-
"selector": "rhel10",
8+
"selector": "rhel10,hardcoded",
99
"feature_name": "RHEL-OS-x86_64",
1010
"origin": "red_hat"
1111
},
@@ -15,7 +15,7 @@
1515
"url": "https://cdn.redhat.com/content/dist/rhel10/10/aarch64/appstream/os",
1616
"distribution_arch": "aarch64",
1717
"distribution_version": "10",
18-
"selector": "rhel10",
18+
"selector": "rhel10,hardcoded",
1919
"feature_name": "RHEL-OS-x86_64",
2020
"origin": "red_hat"
2121
},
@@ -31,7 +31,7 @@
3131
},
3232
{
3333
"name": "Red Hat Enterprise Linux 10 for ARM 64 - Extensions (RPMs)",
34-
"content_label" :"rhel-10-for-aarch64-extensions-rpms",
34+
"content_label": "rhel-10-for-aarch64-extensions-rpms",
3535
"url": "https://cdn.redhat.com/content/dist/rhel10/10/aarch64/extensions/os",
3636
"distribution_arch": "aarch64",
3737
"distribution_version": "10",

scripts/time_valid_repos.sh

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/bin/bash
2+
3+
# Measure how long it takes to import, and snapshot or introspect particular repositories and wait until they become valid
4+
# Run the backend locally
5+
6+
echo "------------------------------------------"
7+
echo "Importing repos and forcing a snapshot..."
8+
echo "------------------------------------------"
9+
10+
# # original - epel10 and small
11+
# OPTIONS_REPOSITORY_IMPORT_FILTER=small go run ./cmd/external-repos/main.go import
12+
# go run cmd/external-repos/main.go snapshot --url https://cdn.redhat.com/content/dist/rhel9/9/aarch64/codeready-builder/os/ --force
13+
14+
# OPTIONS_REPOSITORY_IMPORT_FILTER=epel10 go run ./cmd/external-repos/main.go import
15+
# go run cmd/external-repos/main.go snapshot --url https://dl.fedoraproject.org/pub/epel/10/Everything/x86_64/ --force
16+
# # --
17+
18+
SECONDS=0
19+
20+
# update - hardcoded rhel 10, aarch: baseos and appstream
21+
OPTIONS_REPOSITORY_IMPORT_FILTER=hardcoded go run ./cmd/external-repos/main.go import
22+
go run cmd/external-repos/main.go snapshot --url https://cdn.redhat.com/content/dist/rhel10/10/aarch64/appstream/os/ --force
23+
24+
OPTIONS_REPOSITORY_IMPORT_FILTER=hardcoded go run ./cmd/external-repos/main.go import
25+
go run cmd/external-repos/main.go snapshot --url https://cdn.redhat.com/content/dist/rhel10/10/aarch64/baseos/os/ --force
26+
27+
OPTIONS_REPOSITORY_IMPORT_FILTER=epel10 go run ./cmd/external-repos/main.go import
28+
go run cmd/external-repos/main.go introspect --url https://dl.fedoraproject.org/pub/epel/10/Everything/x86_64/ --force
29+
30+
echo "------------------------------------------"
31+
echo "Repos imported."
32+
echo "------------------------------------------"
33+
echo "Checking snapshot status of all repos..."
34+
echo "------------------------------------------"
35+
36+
while [[ "$(curl -s http://localhost:8000/api/content-sources/v1.0/repositories/ -H "$( ./scripts/header.sh 12675780 1111)" | jq '.data | all(.status == "Valid")')" == "false" ]]; do
37+
echo "[$(date +%H:%M:%S)] Waiting... (${SECONDS}s elapsed)"
38+
sleep 5
39+
done
40+
41+
duration=$SECONDS
42+
43+
echo "------------------------------------------"
44+
echo "Success! All snapshots are Valid."
45+
printf "%d min %d s\n" $((duration/60)) $((duration%60))
46+
echo "${duration}s"
47+
echo "------------------------------------------"

0 commit comments

Comments
 (0)