Skip to content
Merged
82 changes: 82 additions & 0 deletions .github/workflows/devenv-cron.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Cron Smoke Test

on:
schedule:
- cron: "0 6 * * *" # Run daily at 6 AM
workflow_dispatch:

defaults:
run:
working-directory: devenv

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.sha }}
cancel-in-progress: true

jobs:
smoke:
permissions:
id-token: write
contents: read
pull-requests: write
runs-on: ubuntu24.04-16cores-64GB # ghv-ignore!

Check failure on line 22 in .github/workflows/devenv-cron.yml

View workflow job for this annotation

GitHub Actions / Validate Workflow Changes

1. new ignore comment found (ignore-comment / error) 2. This Ubuntu runner is 4-8 more expensive than a base Ubuntu runner. Consider using a smaller Ubuntu runner. (runner-ubuntu / ignored)
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1

- name: Install Just
uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3
with:
just-version: "1.40.0"

- name: Configure AWS credentials using OIDC
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
with:
role-to-assume: ${{ secrets.AWS_OIDC_IAM_ROLE_SDLC_ECR_READONLY_ARN }}
aws-region: us-west-2

- name: Authenticate to ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 # v2.0.1

- name: Set up Go
uses: actions/setup-go@v6 # v6
with:
cache: true
go-version-file: devenv/go.mod
cache-dependency-path: devenv/go.sum

- name: Download Go dependencies
run: |
go mod download

- name: Set environment variables
id: set-env
run: |
echo "CHAINLINK_IMAGE=${{ secrets.REGISTRY_SDLC }}/chainlink:nightly-$(date +%Y%m%d)" >> $GITHUB_ENV

- name: Run Cron environment
env:
FAKE_SERVER_IMAGE: ${{ secrets.FAKE_SERVER_IMAGE }}
run: |
cd cmd/cl && go install . && cd -
cl u env.toml,products/cron/basic.toml

- name: Run tests
working-directory: devenv/tests/cron
run: |
echo "Running tests for: $CHAINLINK_IMAGE, product: Cron"
go test -v -run TestSmoke

- name: Upload Logs
if: always()
uses: actions/upload-artifact@v4
with:
name: container-logs-smoke
path: devenv/tests/cron/logs
retention-days: 3
82 changes: 82 additions & 0 deletions .github/workflows/devenv-direct-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Direct Request Smoke Test

on:
schedule:
- cron: "0 6 * * *" # Run daily at 6 AM
workflow_dispatch:

defaults:
run:
working-directory: devenv

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.sha }}
cancel-in-progress: true

jobs:
smoke:
permissions:
id-token: write
contents: read
pull-requests: write
runs-on: ubuntu24.04-16cores-64GB # ghv-ignore!

Check failure on line 22 in .github/workflows/devenv-direct-request.yml

View workflow job for this annotation

GitHub Actions / Validate Workflow Changes

1. new ignore comment found (ignore-comment / error) 2. This Ubuntu runner is 4-8 more expensive than a base Ubuntu runner. Consider using a smaller Ubuntu runner. (runner-ubuntu / ignored)
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1

- name: Install Just
uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3
with:
just-version: "1.40.0"

- name: Configure AWS credentials using OIDC
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
with:
role-to-assume: ${{ secrets.AWS_OIDC_IAM_ROLE_SDLC_ECR_READONLY_ARN }}
aws-region: us-west-2

- name: Authenticate to ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 # v2.0.1

- name: Set up Go
uses: actions/setup-go@v6 # v6
with:
cache: true
go-version-file: devenv/go.mod
cache-dependency-path: devenv/go.sum

- name: Download Go dependencies
run: |
go mod download

- name: Set environment variables
id: set-env
run: |
echo "CHAINLINK_IMAGE=${{ secrets.REGISTRY_SDLC }}/chainlink:nightly-$(date +%Y%m%d)" >> $GITHUB_ENV

- name: Run Direct Request environment
env:
FAKE_SERVER_IMAGE: ${{ secrets.FAKE_SERVER_IMAGE }}
run: |
cd cmd/cl && go install . && cd -
cl u env.toml,products/directrequest/basic.toml

- name: Run tests
working-directory: devenv/tests/directrequest
run: |
echo "Running tests for: $CHAINLINK_IMAGE, product: Direct Request"
go test -v -run TestSmoke

- name: Upload Logs
if: always()
uses: actions/upload-artifact@v4
with:
name: container-logs-smoke
path: devenv/tests/directrequest/logs
retention-days: 3
82 changes: 82 additions & 0 deletions .github/workflows/devenv-flux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Flux Smoke Test

on:
schedule:
- cron: "0 6 * * *" # Run daily at 6 AM
workflow_dispatch:

defaults:
run:
working-directory: devenv

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}-${{ github.sha }}
cancel-in-progress: true

jobs:
smoke:
permissions:
id-token: write
contents: read
pull-requests: write
runs-on: ubuntu24.04-16cores-64GB # ghv-ignore!

Check failure on line 22 in .github/workflows/devenv-flux.yml

View workflow job for this annotation

GitHub Actions / Validate Workflow Changes

1. new ignore comment found (ignore-comment / error) 2. This Ubuntu runner is 4-8 more expensive than a base Ubuntu runner. Consider using a smaller Ubuntu runner. (runner-ubuntu / ignored)
steps:
- name: Checkout code
uses: actions/checkout@v5
with:
fetch-depth: 0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@e468171a9de216ec08956ac3ada2f0791b6bd435 # v3.11.1

- name: Install Just
uses: extractions/setup-just@e33e0265a09d6d736e2ee1e0eb685ef1de4669ff # v3
with:
just-version: "1.40.0"

- name: Configure AWS credentials using OIDC
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
with:
role-to-assume: ${{ secrets.AWS_OIDC_IAM_ROLE_SDLC_ECR_READONLY_ARN }}
aws-region: us-west-2

- name: Authenticate to ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 # v2.0.1

- name: Set up Go
uses: actions/setup-go@v6 # v6
with:
cache: true
go-version-file: devenv/go.mod
cache-dependency-path: devenv/go.sum

- name: Download Go dependencies
run: |
go mod download

- name: Set environment variables
id: set-env
run: |
echo "CHAINLINK_IMAGE=${{ secrets.REGISTRY_SDLC }}/chainlink:nightly-$(date +%Y%m%d)" >> $GITHUB_ENV

- name: Run Flux environment
env:
FAKE_SERVER_IMAGE: ${{ secrets.FAKE_SERVER_IMAGE }}
run: |
cd cmd/cl && go install . && cd -
cl u env.toml,products/flux/basic.toml

- name: Run tests
working-directory: devenv/tests/flux
run: |
echo "Running tests for: $CHAINLINK_IMAGE, product: Flux"
go test -v -run TestSmoke

- name: Upload Logs
if: always()
uses: actions/upload-artifact@v4
with:
name: container-logs-smoke
path: devenv/tests/flux/logs
retention-days: 3
12 changes: 6 additions & 6 deletions devenv/cmd/cl/chainlink.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,14 +202,14 @@ var obsRestartCmd = &cobra.Command{
}

var testCmd = &cobra.Command{
Use: "ocr2:test",
Short: "Run the OCR2 tests",
Use: "test",
Short: "Run the tests",
RunE: func(cmd *cobra.Command, args []string) error {
if len(args) != 1 {
return errors.New("specify the 'go test -run' filter, ex.: $TestName/$subtest")
if len(args) != 2 {
return errors.New("specify the test folder and run filter: $test_folder $go_test_run_filter")
}
testCmd := exec.Command("go", "test", "-v", "-timeout", "4h", "-run", args[0]) //nolint:gosec //nothing else can run here except tests
testCmd.Dir = filepath.Join("tests", "ocr2")
testCmd := exec.Command("go", "test", "-v", "-timeout", "4h", "-run", args[1]) //nolint:gosec //nothing else can run here except tests
testCmd.Dir = filepath.Join("tests", args[0])
testCmd.Stdout = os.Stdout
testCmd.Stderr = os.Stderr
testCmd.Stdin = os.Stdin
Expand Down
19 changes: 14 additions & 5 deletions devenv/cmd/cl/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@ func getCommands() []prompt.Suggest {

func getSubCommands(parent string) []prompt.Suggest {
switch parent {
case "ocr2:test":
case "test":
return []prompt.Suggest{
{Text: "TestOCR2Load/clean", Description: "Run OCR2 soak test"},
{Text: "TestOCR2Load/gas-spikes", Description: "Run OCR2 soak test + simulate gas spikes"},
{Text: "TestOCR2Load/chaos", Description: "Run OCR2 soak test + introduce container kills and latency"},
{Text: "cron TestSmoke", Description: "Run Cron trigger test"},
{Text: "directrequest TestSmoke", Description: "Run Direct Request test"},
{Text: "flux TestSmoke", Description: "Run Flux test"},
{Text: "ocr2 TestOCR2Load/clean", Description: "Run OCR2 soak test"},
{Text: "ocr2 TestOCR2Load/gas-spikes", Description: "Run OCR2 soak test + simulate gas spikes"},
{Text: "ocr2 TestOCR2Load/chaos", Description: "Run OCR2 soak test + introduce container kills and latency"},
}
case "bs":
return []prompt.Suggest{
Expand All @@ -57,8 +60,14 @@ func getSubCommands(parent string) []prompt.Suggest {
case "restart":
return []prompt.Suggest{
{Text: "env.toml", Description: "Spin up Anvil <> Anvil local chains, all services, 4 CL nodes"},
{Text: "env.toml,products/cron/basic.toml", Description: "1 Anvil, 1 CL Node, Cron trigger"},
{Text: "env.toml,products/cron/soak.toml", Description: "1 Anvil, 1 CL Node, 10 Cron triggers for soak testing"},
{Text: "env.toml,products/directrequest/basic.toml", Description: "1 Anvil, 1 CL Node, Runlog trigger"},
{Text: "env.toml,products/directrequest/soak.toml", Description: "1 Anvil, 1 CL Node, 10 Runlog triggers for soak testing"},
{Text: "env.toml,products/flux/basic.toml", Description: "1 Anvil, 1 CL Node, Runlog trigger"},
{Text: "env.toml,products/flux/soak.toml", Description: "1 Anvil, 1 CL Node, 10 Runlog triggers for soak testing"},
{Text: "env.toml,products/ocr2/basic.toml", Description: "2 Anvils, 4 CL Nodes, 1 OCRv2 product"},
{Text: "env.toml,products/ocr2/basic.toml,products/ocr2/soak.toml", Description: "2 Anvils, 4 CL Nodes, 5 OCRv2 product for soak testing"},
{Text: "env.toml,products/ocr2/basic.toml,products/ocr2/soak.toml", Description: "2 Anvils, 4 CL Nodes, 10 OCRv2 product for soak testing"},
{Text: "env.toml,env-cl-rebuild.toml", Description: "Spin up Anvil <> Anvil local chains, all services, 4 CL nodes (custom build)"},
{Text: "env.toml,env-geth.toml", Description: "Spin up Geth <> Geth local chains (clique), all services, 4 CL nodes"},
{Text: "env.toml,env-fuji-fantom.toml", Description: "Spin up testnets: Fuji <> Fantom, all services, 4 CL nodes"},
Expand Down
9 changes: 9 additions & 0 deletions devenv/environment.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ import (

ns "github.com/smartcontractkit/chainlink-testing-framework/framework/components/simple_node_set"
"github.com/smartcontractkit/chainlink/devenv/products/automation"
"github.com/smartcontractkit/chainlink/devenv/products/cron"
"github.com/smartcontractkit/chainlink/devenv/products/directrequest"
"github.com/smartcontractkit/chainlink/devenv/products/flux"
"github.com/smartcontractkit/chainlink/devenv/products/keepers"
"github.com/smartcontractkit/chainlink/devenv/products/ocr2"
)
Expand All @@ -33,6 +36,12 @@ type Cfg struct {

func newProduct(name string) (Product, error) {
switch name {
case "cron":
return cron.NewConfigurator(), nil
case "direct_request":
return directrequest.NewConfigurator(), nil
case "flux":
return flux.NewConfigurator(), nil
case "ocr2":
return ocr2.NewConfigurator(), nil
case "automation":
Expand Down
2 changes: 1 addition & 1 deletion devenv/fakes/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.24 AS builder
FROM golang:1.25 AS builder

ENV GOPRIVATE=github.com/smartcontractkit/*

Expand Down
26 changes: 26 additions & 0 deletions devenv/fakes/cron/cron.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package cron

import (
"os"

"github.com/gin-gonic/gin"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"

"github.com/smartcontractkit/chainlink-testing-framework/framework/components/fake"
)

var L = log.Output(zerolog.ConsoleWriter{Out: os.Stderr}).Level(zerolog.DebugLevel).With().Fields(map[string]any{"component": "fake-cron"}).Logger()

var result = 200

func RegisterRoutes() error {
return fake.Func("POST", "/cron_response", func(ctx *gin.Context) {
L.Info().Int("Result", result).Msg("Returning feed value result")
ctx.JSON(200, gin.H{
"data": map[string]any{
"result": result,
},
})
})
}
26 changes: 26 additions & 0 deletions devenv/fakes/directrequest/directrequest.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
package directrequest

import (
"os"

"github.com/gin-gonic/gin"
"github.com/rs/zerolog"
"github.com/rs/zerolog/log"

"github.com/smartcontractkit/chainlink-testing-framework/framework/components/fake"
)

var L = log.Output(zerolog.ConsoleWriter{Out: os.Stderr}).Level(zerolog.DebugLevel).With().Fields(map[string]any{"component": "fake-cron"}).Logger()

var result = 200

func RegisterRoutes() error {
return fake.Func("POST", "/direct_request_response", func(ctx *gin.Context) {
L.Info().Int("Result", result).Msg("Returning feed value result")
ctx.JSON(200, gin.H{
"data": map[string]any{
"result": result,
},
})
})
}
Loading
Loading