Skip to content

Commit f8f7fc5

Browse files
committed
Merge branch 'main' into CRE-781-call-teardown-on-test-end
2 parents aecb804 + b393ad4 commit f8f7fc5

File tree

13 files changed

+505
-128
lines changed

13 files changed

+505
-128
lines changed
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: Framework Docker Compose Tests
2+
on:
3+
push:
4+
5+
jobs:
6+
test:
7+
defaults:
8+
run:
9+
working-directory: framework/examples/myproject
10+
runs-on: ubuntu-latest
11+
permissions:
12+
id-token: write
13+
contents: read
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
test:
18+
- name: TestChipIngressSmoke
19+
config: smoke_chip.toml
20+
count: 1
21+
timeout: 3m
22+
name: ${{ matrix.test.name }}
23+
steps:
24+
- name: Checkout repo
25+
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
26+
27+
- name: Configure AWS credentials using OIDC
28+
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
29+
with:
30+
role-to-assume: ${{ secrets.AWS_CTF_READ_ACCESS_ROLE_ARN }}
31+
aws-region: us-west-2
32+
33+
- name: Login to Amazon ECR
34+
id: login-ecr-private
35+
uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 # v2.0.1
36+
with:
37+
registries: ${{ format('{0},{1}', secrets.AWS_ACCOUNT_ID_SDLC, secrets.AWS_ACCOUNT_ID_PROD) }}
38+
env:
39+
AWS_REGION: us-west-2
40+
41+
- name: Check for changes in Docker Components
42+
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
43+
id: changes
44+
with:
45+
filters: |
46+
src:
47+
- 'framework/components/dockercompose/**'
48+
- '.github/workflows/framework-components-tests.yml'
49+
50+
- name: Set up Go
51+
uses: actions/setup-go@v5
52+
with:
53+
go-version: '1.24.0'
54+
55+
- name: Cache Go modules
56+
uses: actions/cache@v4
57+
with:
58+
path: |
59+
~/.cache/go-build
60+
~/go/pkg/mod
61+
key: go-modules-${{ hashFiles('framework/examples/myproject/go.sum') }}-${{ runner.os }}-framework-golden-examples
62+
restore-keys: |
63+
go-modules-${{ runner.os }}-framework-golden-examples
64+
go-modules-${{ runner.os }}
65+
66+
- name: Install dependencies
67+
run: go mod download
68+
69+
- name: Run System Tests
70+
if: steps.changes.outputs.src == 'true'
71+
env:
72+
CTF_CONFIGS: ${{ matrix.test.config }}
73+
CHIP_INGRESS_IMAGE: ${{ secrets.AWS_ACCOUNT_ID_PROD }}.dkr.ecr.us-west-2.amazonaws.com/atlas-chip-ingress:qa-latest
74+
CTF_LOG_LEVEL: debug
75+
run: |
76+
go test -timeout ${{ matrix.test.timeout }} -v -count ${{ matrix.test.count }} -run ${{ matrix.test.name }}
77+
78+
- name: Upload Logs
79+
if: always()
80+
uses: actions/upload-artifact@v4
81+
with:
82+
name: container-logs-${{ matrix.test.name }}
83+
path: framework/examples/myproject/logs
84+
retention-days: 1

framework/.changeset/v0.10.16.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- Use volumes for user's home directory and `config` folder for the CL node
2+
- Store cached config on absolute path if the relative doesn't work

framework/components/clnode/clnode.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ const (
2929
TmpImageName = "chainlink-tmp:latest"
3030
CustomPortSeparator = ":"
3131
DefaultCapabilitiesDir = "/usr/local/bin"
32+
ConfigVolumeName = "clnode-config"
33+
HomeVolumeName = "clnode-home"
3234
)
3335

3436
var (
@@ -253,6 +255,23 @@ func newNode(in *Input, pgOut *postgres.Output) (*NodeOut, error) {
253255
WithPort(DefaultHTTPPort).
254256
WithStartupTimeout(3 * time.Minute).
255257
WithPollInterval(200 * time.Millisecond),
258+
Mounts: tc.ContainerMounts{
259+
{
260+
// various configuration files
261+
Source: tc.GenericVolumeMountSource{
262+
Name: ConfigVolumeName + "-" + in.Node.Name,
263+
},
264+
Target: "/config",
265+
},
266+
{
267+
// kv store of the OCR jobs and other state files are stored
268+
// in the user's home instead of the DB
269+
Source: tc.GenericVolumeMountSource{
270+
Name: HomeVolumeName + "-" + in.Node.Name,
271+
},
272+
Target: "/home/chainlink",
273+
},
274+
},
256275
}
257276
if in.Node.HTTPPort != 0 && in.Node.P2PPort != 0 {
258277
req.HostConfigModifier = func(h *container.HostConfig) {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Pass all environment variables to Docker Compose
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- Add topological sorting of proto dependencies for the local-cre
2+
- Add support for exclude files to proto registration config
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
- Revert topological sorting of proto dependencies for the local-cre
2+
- Revert support for exclude files to proto registration config
3+
- Add retry on proto registration
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- Bring back topological sorting of proto dependencies for the local-cre
2+
- Bring back support for exclude files to proto registration config

framework/components/dockercompose/chip_ingress_set/chip_ingress.go

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,11 +94,21 @@ func New(in *Input) (*Output, error) {
9494
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute)
9595
defer cancel()
9696

97+
// Start the stackwith all environment variables from the host process
98+
// set BASIC_AUTH_ENABLED and BASIC_AUTH_PREFIX to false and empty string and allow them to be overridden by the host process
99+
envVars := make(map[string]string)
100+
envVars["BASIC_AUTH_ENABLED"] = "false"
101+
envVars["BASIC_AUTH_PREFIX"] = ""
102+
103+
for _, env := range os.Environ() {
104+
pair := strings.SplitN(env, "=", 2)
105+
if len(pair) == 2 {
106+
envVars[pair[0]] = pair[1]
107+
}
108+
}
109+
97110
upErr := stack.
98-
WithEnv(map[string]string{
99-
"BASIC_AUTH_ENABLED": "false",
100-
"BASIC_AUTH_PREFIX": "",
101-
}).
111+
WithEnv(envVars).
102112
Up(ctx)
103113

104114
if upErr != nil {
@@ -118,6 +128,7 @@ func New(in *Input) (*Output, error) {
118128
wait.NewHostPortStrategy(DEFAULT_RED_PANDA_SCHEMA_REGISTRY_PORT).WithPollInterval(100*time.Millisecond),
119129
wait.NewHostPortStrategy(DEFAULT_RED_PANDA_KAFKA_PORT).WithPollInterval(100*time.Millisecond),
120130
wait.ForHTTP("/v1/status/ready").WithPort("9644"), // admin API port
131+
wait.ForHTTP("/status/ready").WithPort(DEFAULT_RED_PANDA_SCHEMA_REGISTRY_PORT).WithPollInterval(100*time.Millisecond),
121132
).WithDeadline(2*time.Minute),
122133
).WaitForService(DEFAULT_RED_PANDA_CONSOLE_SERVICE_NAME,
123134
wait.ForAll(

0 commit comments

Comments
 (0)