Skip to content

Commit 1d4c2c9

Browse files
authored
fix: update to run E2E tests for morse/shannon in parallel (#75)
1 parent 36dbb7f commit 1d4c2c9

File tree

6 files changed

+121
-49
lines changed

6 files changed

+121
-49
lines changed

.github/workflows/run-tests.yml

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ jobs:
4747
run: CGO_ENABLED=0 go test ./... -short
4848

4949
test-docker-build:
50-
name: Test build of Docker image
50+
name: Verify Docker image builds successfully
5151
runs-on: "ubuntu-22.04"
5252
steps:
5353
- uses: docker/build-push-action@v2
@@ -59,7 +59,8 @@ jobs:
5959
load: true
6060
tags: test-build
6161

62-
e2e-testing:
62+
e2e-testing-morse:
63+
name: Run Morse E2E Tests
6364
runs-on: "ubuntu-22.04"
6465
steps:
6566
- uses: actions/checkout@v4
@@ -69,15 +70,6 @@ jobs:
6970
with:
7071
go-version: "1.22.3"
7172

72-
- name: copy Shannon E2E config
73-
run: make copy_shannon_e2e_config
74-
75-
- name: update Shannon E2E config from secrets
76-
env:
77-
SHANNON_GATEWAY_PRIVATE_KEY: ${{ secrets.SHANNON_GATEWAY_PRIVATE_KEY }}
78-
SHANNON_OWNED_APPS_PRIVATE_KEYS: ${{ secrets.SHANNON_OWNED_APPS_PRIVATE_KEYS}}
79-
run: ./e2e/scripts/update_shannon_config_from_secrets.sh
80-
8173
- name: copy Morse E2E config
8274
run: make copy_morse_e2e_config
8375

@@ -88,8 +80,29 @@ jobs:
8880
MORSE_AATS: ${{ secrets.MORSE_AATS }}
8981
run: ./e2e/scripts/update_morse_config_from_secrets.sh
9082

83+
- name: Run Morse E2E Tests
84+
run: make test_e2e_morse_relay
85+
86+
e2e-testing-shannon:
87+
name: Run Shannon E2E Tests
88+
runs-on: "ubuntu-22.04"
89+
steps:
90+
- uses: actions/checkout@v4
91+
92+
- name: Set up Go
93+
uses: actions/setup-go@v5
94+
with:
95+
go-version: "1.22.3"
96+
97+
- name: copy Shannon E2E config
98+
run: make copy_shannon_e2e_config
99+
100+
- name: update Shannon E2E config from secrets
101+
env:
102+
SHANNON_GATEWAY_PRIVATE_KEY: ${{ secrets.SHANNON_GATEWAY_PRIVATE_KEY }}
103+
SHANNON_OWNED_APPS_PRIVATE_KEYS: ${{ secrets.SHANNON_OWNED_APPS_PRIVATE_KEYS}}
104+
run: ./e2e/scripts/update_shannon_config_from_secrets.sh
105+
91106
- name: Run Shannon E2E Tests
92107
run: make test_e2e_shannon_relay
93108

94-
- name: Run Morse E2E Tests
95-
run: make test_e2e_morse_relay

Makefile

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,10 @@ test_e2e_morse_relay: ## Run an E2E Morse relay test
6969
copy_shannon_config: ## copies the example shannon configuration yaml file to .config.yaml file
7070
@if [ ! -f ./cmd/.config.yaml ]; then \
7171
cp ./cmd/.config.shannon_example.yaml ./cmd/.config.yaml; \
72-
echo "#######################################################################################################"; \
73-
echo "### Created ./cmd/.config.yaml ###"; \
74-
echo "### README: Please update the the following in .config.yaml: gateway_private_key & gateway_address. ###"; \
75-
echo "#######################################################################################################"; \
72+
echo "###########################################################################################################################"; \
73+
echo "### Created ./cmd/.config.yaml ###"; \
74+
echo "### README: Please update the the following in .config.yaml: 'gateway_private_key_hex' & 'owned_apps_private_keys_hex'. ###"; \
75+
echo "###########################################################################################################################"; \
7676
else \
7777
echo "###########################################################"; \
7878
echo "### ./cmd/.config.yaml already exists, not overwriting. ###"; \
@@ -83,10 +83,10 @@ copy_shannon_config: ## copies the example shannon configuration yaml file to .c
8383
copy_morse_config: ## copies the example morse configuration yaml file to .config.yaml file
8484
@if [ ! -f ./cmd/.config.yaml ]; then \
8585
cp ./cmd/.config.morse_example.yaml ./cmd/.config.yaml; \
86-
echo "#######################################################################################################"; \
87-
echo "### Created ./cmd/.config.yaml ###"; \
88-
echo "### README: Please update the the following in .config.yaml: gateway_private_key & gateway_address. ###"; \
89-
echo "#######################################################################################################"; \
86+
echo "#############################################################################################################"; \
87+
echo "### Created ./cmd/.config.yaml ###"; \
88+
echo "### README: Please update the the following in .config.yaml: 'url', 'relay_signing_key', & 'signed_aats'. ###"; \
89+
echo "#############################################################################################################"; \
9090
else \
9191
echo "###########################################################"; \
9292
echo "### ./cmd/.config.yaml already exists, not overwriting. ###"; \
@@ -97,10 +97,10 @@ copy_morse_config: ## copies the example morse configuration yaml file to .confi
9797
copy_shannon_e2e_config: ## copies the example Shannon test configuration yaml file to .gitignored .shannon.config.yaml file
9898
@if [ ! -f ./e2e/.shannon.config.yaml ]; then \
9999
cp ./e2e/shannon.example.yaml ./e2e/.shannon.config.yaml; \
100-
echo "###############################################################################################################"; \
101-
echo "### Created ./e2e/.shannon.config.yaml ###"; \
102-
echo "### README: Please update the the following in .shannon.config.yaml: gateway_private_key & gateway_address. ###"; \
103-
echo "###############################################################################################################"; \
100+
echo "###################################################################################################################################"; \
101+
echo "### Created ./e2e/.shannon.config.yaml ###"; \
102+
echo "### README: Please update the the following in .shannon.config.yaml: 'gateway_private_key_hex' & 'owned_apps_private_keys_hex'. ###"; \
103+
echo "###################################################################################################################################"; \
104104
else \
105105
echo "###################################################################"; \
106106
echo "### ./e2e/.shannon.config.yaml already exists, not overwriting. ###"; \
@@ -111,10 +111,10 @@ copy_shannon_e2e_config: ## copies the example Shannon test configuration yaml f
111111
copy_morse_e2e_config: ## copies the example Morse test configuration yaml file to .gitignored ..morse.config.yaml file.
112112
@if [ ! -f ./e2e/.morse.config.yaml ]; then \
113113
cp ./e2e/morse.example.yaml ./e2e/.morse.config.yaml; \
114-
echo "#############################################################################################################"; \
115-
echo "### Created ./e2e/.morse.config.yaml ###"; \
116-
echo "### README: Please update the the following in .morse.config.yaml: gateway_private_key & gateway_address. ###"; \
117-
echo "#############################################################################################################"; \
114+
echo "###################################################################################################################"; \
115+
echo "### Created ./e2e/.morse.config.yaml ###"; \
116+
echo "### README: Please update the the following in .morse.config.yaml: 'url', 'relay_signing_key', & 'signed_aats'. ###"; \
117+
echo "###################################################################################################################"; \
118118
else \
119119
echo "#################################################################"; \
120120
echo "### ./e2e/.morse.config.yaml already exists, not overwriting. ###"; \

config/config.schema.yaml

Lines changed: 49 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,14 @@
44
# To validate the config file, the following comment must be placed at the top of the .config.yaml file:
55
# <REMOVE THIS TAG> yaml-language-server: $schema=https://raw.githubusercontent.com/buildwithgrove/path/refs/heads/main/config/config.schema.yaml
66

7+
description: "PATH Gateway Configuration YAML: this file is used to configure a PATH gateway for either Morse or Shannon."
78
type: object
89
additionalProperties: false
910
required:
1011
- services
12+
oneOf:
13+
- required: ["morse_config"]
14+
- required: ["shannon_config"]
1115

1216
properties:
1317
# NOTE: Exactly one of either "morse_config" or "shannon_config" must be present
@@ -18,19 +22,23 @@ properties:
1822

1923
# Morse Configuration (required for Morse gateways)
2024
morse_config:
25+
description: "Configuration for the Morse gateway; if specified, the PATH instance will use the Morse version of the Pocket protocol."
2126
type: object
2227
additionalProperties: false
2328
properties:
2429
full_node_config:
30+
description: "Configuration for the full node for Morse gateways. This configuration is used to connect to the Morse full node to get data from the Pocket blockchain."
2531
type: object
2632
additionalProperties: false
2733
required:
2834
- url
2935
properties:
3036
url:
37+
description: "The URL of the full Morse Pocket node."
3138
type: string
3239
pattern: "^(http|https)://.*$"
3340
relay_signing_key:
41+
description: "The relay signing key for Morse gateways. This key is used to sign relays sent through the Morse gateway."
3442
type: string
3543
pattern: "^[0-9a-fA-F]{128}$"
3644
http_config:
@@ -39,9 +47,12 @@ properties:
3947
properties:
4048
retries:
4149
type: integer
50+
description: "Number of retries for HTTP requests using the Pocket Go SDK. (optional, defaults to 0)"
4251
timeout:
52+
description: "Timeout duration for HTTP requests using the Pocket Go SDK. (optional, defaults to 5 seconds)"
4353
type: string
4454
transport:
55+
description: "HTTP transport configuration for the Pocket Go SDK. (optional, sensible defaults are provided)"
4556
type: object
4657
additionalProperties: false
4758
properties:
@@ -57,78 +68,88 @@ properties:
5768
type: string
5869
keep_alive:
5970
type: string
60-
request_config:
61-
type: object
62-
additionalProperties: false
63-
properties:
64-
retries:
65-
type: integer
6671
signed_aats:
6772
type: object
6873
additionalProperties: false
6974
patternProperties:
7075
"^[0-9a-fA-F]{40}$":
7176
type: object
7277
additionalProperties: false
78+
required:
79+
- client_public_key
80+
- application_public_key
81+
- application_signature
7382
properties:
7483
client_public_key:
84+
description: "Client public key for the Morse AAT."
7585
type: string
7686
pattern: "^[0-9a-fA-F]{64}$"
7787
application_public_key:
88+
description: "Application public key for the Morse AAT."
7889
type: string
7990
pattern: "^[0-9a-fA-F]{64}$"
8091
application_signature:
8192
type: string
8293
pattern: "^[0-9a-fA-F]{128}$"
83-
required:
84-
- client_public_key
85-
- application_public_key
86-
- application_signature
94+
description: "Signature of the application for the Morse AAT."
8795

8896
# Shannon Configuration (required for Shannon gateways)
8997
shannon_config:
98+
description: "Configuration for the Shannon gateway; if specified, the PATH instance will use the Shannon version of the Pocket protocol."
9099
type: object
91100
additionalProperties: false
92101
required:
93102
- full_node_config
94103
- gateway_config
95104
properties:
96105
full_node_config:
106+
description: "Configuration for the Shannon full node. This configuration is used to connect to the Shannon full node to get data from the Pocket blockchain."
97107
type: object
98108
additionalProperties: false
99109
required:
100110
- rpc_url
101111
- grpc_config
102112
properties:
103113
rpc_url:
114+
description: "HTTP URL for the Shannon full node."
104115
type: string
105116
pattern: "^(http|https)://.*$"
106117
grpc_config:
118+
description: "gRPC configuration for the Shannon full node."
107119
type: object
108120
additionalProperties: false
109121
required:
110122
- host_port
111123
properties:
112124
host_port:
125+
description: "Host and port for gRPC connections, eg. 127.0.0.1:4040"
113126
type: string
114127
pattern: "^[^:]+:[0-9]+$"
115128
insecure:
129+
description: "Indicates if the gRPC connection is insecure. Must be specified if the full node is notusing TLS."
116130
type: boolean
117131
default: false
118132
base_delay:
133+
description: "Base delay for gRPC retries."
119134
type: string
120135
max_delay:
136+
description: "Maximum delay for gRPC retries."
121137
type: string
122138
min_connect_timeout:
139+
description: "Minimum connection timeout for gRPC."
123140
type: string
124141
keep_alive_time:
142+
description: "Keep-alive time for gRPC connections."
125143
type: string
126144
keep_alive_timeout:
145+
description: "Keep-alive timeout for gRPC connections."
127146
type: string
128147
lazy_mode:
148+
description: "Indicates if lazy mode is enabled for full node connections."
129149
type: boolean
130150
default: false
131151
gateway_config:
152+
description: "Configuration for the Shannon gateway, including all required addresses and private keys for all Shannon actors."
132153
type: object
133154
additionalProperties: false
134155
required:
@@ -137,16 +158,20 @@ properties:
137158
- gateway_private_key_hex
138159
properties:
139160
gateway_mode:
161+
description: "Mode of the gateway operation."
140162
type: string
141-
pattern: "^[a-zA-Z0-9]+$"
163+
enum: ["centralized", "delegated", "permissionless"]
142164
gateway_address:
165+
description: "Address of the Shannon gateway."
143166
type: string
144-
pattern: "^pokt1[0-9a-zA-Z]{38}$" # 43 total characters
167+
pattern: "^pokt1[0-9a-zA-Z]{38}$"
145168
gateway_private_key_hex:
169+
description: "Private key of the Shannon gateway in hexadecimal format."
146170
type: string
147171
pattern: "^[0-9a-fA-F]{64}$"
148-
owned_apps_private_keys_hex: # Not required in delegated gateway mode
172+
owned_apps_private_keys_hex:
149173
type: array
174+
description: "Private keys of Shannon Applications owned by the Gateway in hexadecimal format."
150175
items:
151176
type: string
152177
pattern: "^[0-9a-fA-F]{64}$"
@@ -157,36 +182,47 @@ properties:
157182
additionalProperties: false
158183
patternProperties:
159184
"^[a-zA-Z0-9]+$":
185+
description: "Configuration for a service, containing its unique service ID and string alias."
160186
type: object
161187
additionalProperties: false
162188
properties:
163189
alias:
164190
type: string
191+
description: "Alias for the service."
165192
request_timeout:
166193
type: string
194+
description: "Timeout duration for service requests."
167195

168196
# Router Configuration (optional)
169197
router_config:
198+
description: "Optional configuration for the router, which is used to route requests to the correct service."
170199
type: object
171200
additionalProperties: false
172201
properties:
173202
port:
203+
description: "Port number for the router."
174204
type: integer
175205
max_request_body_size:
206+
description: "Maximum size of the request body."
176207
type: integer
177208
read_timeout:
209+
description: "Read timeout duration for the router."
178210
type: string
179211
write_timeout:
212+
description: "Write timeout duration for the router."
180213
type: string
181214
idle_timeout:
215+
description: "Idle timeout duration for the router."
182216
type: string
183217

184218
# Hydrator Configuration (optional)
185219
hydrator_config:
220+
description: "Configuration for the hydrator, which is used to run QoS checks against endpoints of a service."
186221
type: object
187222
additionalProperties: false
188223
properties:
189224
service_ids:
225+
description: "List of service IDs for the hydrator."
190226
type: array
191227
items:
192228
type: string

e2e/morse.example.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@
77
morse_config:
88
full_node_config:
99
url: "https://pocket-network-full-node-url.io"
10-
relay_signing_key: "example_relay_signing_key" # ATTENTION: this is a place-holder for a sensitive data item which should never be shared outside your organization.
10+
relay_signing_key: "40af4e7e1b311c76a573610fe115cd2adf1eeade709cd77ca31ad4472509d38840af4e7e1b311c76a573610fe115cd2adf1eeade709cd77ca31ad4472509d388" # ATTENTION: this is a place-holder for a sensitive data item which should never be shared outside your organization.
1111
http_config:
1212
retries: 3
1313
timeout: "5000ms"
1414
request_config:
1515
retries: 3
1616

17-
signed_aats:
18-
"example_application_address":
19-
client_public_key: "example_application_client_public_key"
20-
application_public_key: "example_application_public_key"
21-
application_signature: "example_application_signature"
17+
signed_aats: # ATTENTION: all signed AAT fields are place-holders for sensitive data items which should never be shared outside your organization.
18+
"40af4e7e1b311c76a573610fe115cd2adf1eeade":
19+
client_public_key: "40af4e7e1b311c76a573610fe115cd2adf1eeade709cd77ca31ad4472509d388"
20+
application_public_key: "40af4e7e1b311c76a573610fe115cd2adf1eeade709cd77ca31ad4472509d388"
21+
application_signature: "40af4e7e1b311c76a573610fe115cd2adf1eeade709cd77ca31ad4472509d38840af4e7e1b311c76a573610fe115cd2adf1eeade709cd77ca31ad4472509d388"
2222

2323
# services is required. At least one service must be configured with a valid id.
2424
# All fields are optional but the id is required.

protocol/morse/protocol.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ func (p *Protocol) BuildRequestContext(
100100
func (p *Protocol) Endpoints(serviceID protocol.ServiceID) ([]protocol.Endpoint, error) {
101101
apps, found := p.getServiceApps(serviceID)
102102
if !found {
103-
return nil, fmt.Errorf("buildRequestContext: no apps found for service %s", serviceID)
103+
return nil, fmt.Errorf("endpoints: no apps found for service %s", serviceID)
104104
}
105105

106106
endpointsIdx, err := p.getAppsUniqueEndpoints(serviceID, apps)

0 commit comments

Comments
 (0)