Skip to content

Commit

Permalink
Merge branch 'develop' into augustus.bump-cairo
Browse files Browse the repository at this point in the history
  • Loading branch information
augustbleeds authored Sep 18, 2024
2 parents 5a3452b + 327d167 commit 66cca32
Show file tree
Hide file tree
Showing 29 changed files with 1,280 additions and 1,670 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/changesets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
# Install nix
- name: Install Nix
uses: cachix/install-nix-action@ba0dd844c9180cbf77aa72a116d6fbc515d0e87b # v27
uses: cachix/install-nix-action@3715ab1a11cac9e991980d7b4a28d80c7ebdd8f9 # nix:v2.24.6
with:
nix_path: nixpkgs=channel:nixos-unstable
# Install dependencies using yarn
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/contracts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Install Nix
uses: cachix/install-nix-action@ba0dd844c9180cbf77aa72a116d6fbc515d0e87b # v27
uses: cachix/install-nix-action@3715ab1a11cac9e991980d7b4a28d80c7ebdd8f9 # nix:v2.24.6
with:
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: |
Expand All @@ -36,7 +36,7 @@ jobs:
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Install Nix
uses: cachix/install-nix-action@ba0dd844c9180cbf77aa72a116d6fbc515d0e87b # v27
uses: cachix/install-nix-action@3715ab1a11cac9e991980d7b4a28d80c7ebdd8f9 # nix:v2.24.6
with:
nix_path: nixpkgs=channel:nixos-unstable

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Install Nix
uses: cachix/install-nix-action@ba0dd844c9180cbf77aa72a116d6fbc515d0e87b # v27
uses: cachix/install-nix-action@3715ab1a11cac9e991980d7b4a28d80c7ebdd8f9 # nix:v2.24.6
with:
nix_path: nixpkgs=channel:nixos-unstable

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- name: Checkout sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Install Nix
uses: cachix/install-nix-action@ba0dd844c9180cbf77aa72a116d6fbc515d0e87b # v27
uses: cachix/install-nix-action@3715ab1a11cac9e991980d7b4a28d80c7ebdd8f9 # nix:v2.24.6
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Parse version
Expand All @@ -33,7 +33,7 @@ jobs:
- name: Checkout sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Install Nix
uses: cachix/install-nix-action@ba0dd844c9180cbf77aa72a116d6fbc515d0e87b # v27
uses: cachix/install-nix-action@3715ab1a11cac9e991980d7b4a28d80c7ebdd8f9 # nix:v2.24.6
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Lint relayer
Expand All @@ -56,7 +56,7 @@ jobs:
- name: Checkout sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Install Nix
uses: cachix/install-nix-action@ba0dd844c9180cbf77aa72a116d6fbc515d0e87b # v27
uses: cachix/install-nix-action@3715ab1a11cac9e991980d7b4a28d80c7ebdd8f9 # nix:v2.24.6
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Lint ops
Expand All @@ -79,7 +79,7 @@ jobs:
- name: Checkout sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Install Nix
uses: cachix/install-nix-action@ba0dd844c9180cbf77aa72a116d6fbc515d0e87b # v27
uses: cachix/install-nix-action@3715ab1a11cac9e991980d7b4a28d80c7ebdd8f9 # nix:v2.24.6
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Lint integration-tests
Expand Down
31 changes: 24 additions & 7 deletions .github/workflows/integration-tests-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ jobs:
build_chainlink_image:
name: Build Chainlink Image ${{matrix.image.name}}
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
environment: integration
permissions:
id-token: write
Expand All @@ -48,20 +50,34 @@ jobs:
hostname: ${{ secrets.GRAFANA_INTERNAL_HOST }}
this-job-name: Build Chainlink Image${{matrix.image.name}}
continue-on-error: true
- name: Check if image exists
- name: Check if chainlink-starknet image exists
id: check-image
uses: smartcontractkit/chainlink-github-actions/docker/image-exists@fc3e0df622521019f50d772726d6bf8dc919dd38 # v2.3.19
with:
repository: chainlink
tag: starknet.${{ github.sha }}${{ matrix.image.tag-suffix }}
AWS_REGION: ${{ secrets.QA_AWS_REGION }}
AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
- name: Get core ref from PR body
if: steps.check-image.outputs.exists == 'false' && github.event_name == 'pull_request'
run: |
comment=$(gh pr view https://github.com/${{ github.repository }}/pull/${{ github.event.pull_request.number }} --json body -q '.body')
core_ref=$(echo $comment | grep -oP 'core ref: \K\S+' || true)
if [ ! -z "$core_ref" ]; then
echo "CUSTOM_CORE_REF=${core_ref}" >> "${GITHUB_ENV}"
else
echo "CUSTOM_CORE_REF=develop" >> "${GITHUB_ENV}"
fi
- name: Set core reference if workflow dispatch
if: steps.check-image.outputs.exists == 'false' && github.event_name == 'workflow_dispatch'
run: |
echo "CUSTOM_CORE_REF=${{ github.event.inputs.cl_branch_ref }}" >> "${GITHUB_ENV}"
- name: Build Image ${{ matrix.image.name }}
if: steps.check-image.outputs.exists == 'false'
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/build-image@fc3e0df622521019f50d772726d6bf8dc919dd38 # v2.3.19
with:
cl_repo: smartcontractkit/chainlink
cl_ref: ${{ github.event.inputs.cl_branch_ref }}
cl_ref: ${{ env.CUSTOM_CORE_REF }}
should_checkout: true
cl_dockerfile: ${{ matrix.image.dockerfile }}
# commit of the caller branch
Expand Down Expand Up @@ -141,7 +157,7 @@ jobs:
- name: Checkout the repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Install Nix
uses: cachix/install-nix-action@ba0dd844c9180cbf77aa72a116d6fbc515d0e87b # v27
uses: cachix/install-nix-action@3715ab1a11cac9e991980d7b4a28d80c7ebdd8f9 # nix:v2.24.6
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Install Cairo
Expand All @@ -155,9 +171,6 @@ jobs:
- name: Generate config overrides
run: | # https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/config/README.md
cat << EOF > config.toml
[ChainlinkImage]
image="${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink"
version="starknet.${{ github.sha }}${{ matrix.image.tag-suffix }}"
[Network]
selected_networks=["SIMULATED"]
[Common]
Expand All @@ -171,7 +184,7 @@ jobs:
# shellcheck disable=SC2086
echo "BASE64_CONFIG_OVERRIDE=$BASE64_CONFIG_OVERRIDE" >> $GITHUB_ENV
- name: Run Tests ${{ matrix.image.name }}
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@fc3e0df622521019f50d772726d6bf8dc919dd38 # v2.3.19
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@00c164251be2a7c5b2b23a6e5f7014982f232c14 # v2.3.31
with:
aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}
test_command_to_run: nix develop -c sh -c "make test=${{ matrix.image.test-name }} test-integration-smoke-ci"
Expand All @@ -184,3 +197,7 @@ jobs:
QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }}
artifacts_location: /home/runner/work/chainlink-starknet/chainlink-starknet/integration-tests/smoke/logs
env:
KILLGRAVE_INTERNAL_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/friendsofgo/killgrave
CHAINLINK_IMAGE: ${{ env.CL_ECR }}
CHAINLINK_VERSION: starknet.${{ github.sha }}${{ matrix.image.tag-suffix }}
8 changes: 6 additions & 2 deletions .github/workflows/integration-tests-soak.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
- name: Checkout the repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Install Nix
uses: cachix/install-nix-action@ba0dd844c9180cbf77aa72a116d6fbc515d0e87b # v27
uses: cachix/install-nix-action@3715ab1a11cac9e991980d7b4a28d80c7ebdd8f9 # nix:v2.24.6
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Install Cairo
Expand All @@ -68,7 +68,7 @@ jobs:
echo "::add-mask::$BASE64_CONFIG_OVERRIDE"
echo "BASE64_CONFIG_OVERRIDE=$BASE64_CONFIG_OVERRIDE" >> "$GITHUB_ENV"
- name: Run Tests
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@fc3e0df622521019f50d772726d6bf8dc919dd38 # v2.3.19
uses: smartcontractkit/chainlink-github-actions/chainlink-testing-framework/run-tests@00c164251be2a7c5b2b23a6e5f7014982f232c14 # v2.3.31
with:
aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}
test_command_to_run: cd ./integration-tests && go test -timeout 24h -count=1 -run TestOCRBasicSoak/embedded ./soak
Expand All @@ -80,4 +80,8 @@ jobs:
QA_AWS_ROLE_TO_ASSUME: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }}
QA_KUBECONFIG: ${{ secrets.QA_KUBECONFIG }}
artifacts_location: /home/runner/work/chainlink-starknet/chainlink-starknet/integration-tests/soak/logs
env:
KILLGRAVE_INTERNAL_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/friendsofgo/killgrave
CHAINLINK_IMAGE: ${{ env.CL_ECR }}
CHAINLINK_VERSION: starknet.${{ github.sha }}${{ matrix.image.tag-suffix }}

4 changes: 2 additions & 2 deletions .github/workflows/integration_gauntlet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Install Nix
uses: cachix/install-nix-action@ba0dd844c9180cbf77aa72a116d6fbc515d0e87b # v27
uses: cachix/install-nix-action@3715ab1a11cac9e991980d7b4a28d80c7ebdd8f9 # nix:v2.24.6
with:
nix_path: nixpkgs=channel:nixos-unstable
extra_nix_config: "sandbox = false"
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Install Nix
uses: cachix/install-nix-action@ba0dd844c9180cbf77aa72a116d6fbc515d0e87b # v27
uses: cachix/install-nix-action@3715ab1a11cac9e991980d7b4a28d80c7ebdd8f9 # nix:v2.24.6
with:
nix_path: nixpkgs=channel:nixos-unstable

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Install Nix
uses: cachix/install-nix-action@ba0dd844c9180cbf77aa72a116d6fbc515d0e87b # v27
uses: cachix/install-nix-action@3715ab1a11cac9e991980d7b4a28d80c7ebdd8f9 # nix:v2.24.6
with:
nix_path: nixpkgs=channel:nixos-unstable

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/relayer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: Checkout sources
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Install Nix
uses: cachix/install-nix-action@ba0dd844c9180cbf77aa72a116d6fbc515d0e87b # v27
uses: cachix/install-nix-action@3715ab1a11cac9e991980d7b4a28d80c7ebdd8f9 # nix:v2.24.6
with:
nix_path: nixpkgs=channel:nixos-unstable

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release/starknet-gauntlet-cli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab # v3.5.2
# Install nix
- name: Install Nix
uses: cachix/install-nix-action@29bd9290ef037a3ecbdafe83cbd2185e9dd0fa0a # v20
uses: cachix/install-nix-action@3715ab1a11cac9e991980d7b4a28d80c7ebdd8f9 # nix:v2.24.6
with:
nix_path: nixpkgs=channel:nixos-unstable
# Install dependencies using yarn
Expand Down
8 changes: 4 additions & 4 deletions integration-tests/common/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import (
"github.com/stretchr/testify/require"
"gopkg.in/guregu/null.v4"

ctfconfig "github.com/smartcontractkit/chainlink-testing-framework/config"
"github.com/smartcontractkit/chainlink-testing-framework/k8s/environment"
"github.com/smartcontractkit/chainlink-testing-framework/k8s/pkg/helm/chainlink"
mock_adapter "github.com/smartcontractkit/chainlink-testing-framework/k8s/pkg/helm/mock-adapter"
ctfconfig "github.com/smartcontractkit/chainlink-testing-framework/lib/config"
"github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/environment"
"github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/pkg/helm/chainlink"
mock_adapter "github.com/smartcontractkit/chainlink-testing-framework/lib/k8s/pkg/helm/mock-adapter"
"github.com/smartcontractkit/chainlink/integration-tests/client"
"github.com/smartcontractkit/chainlink/integration-tests/docker/test_env"
"github.com/smartcontractkit/chainlink/v2/core/services/job"
Expand Down
19 changes: 11 additions & 8 deletions integration-tests/common/test_common.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,12 @@ import (
"fmt"
"math/big"
"net/http"
"os"
"testing"
"time"

test_env_ctf "github.com/smartcontractkit/chainlink-testing-framework/lib/docker/test_env"

"github.com/NethermindEth/juno/core/felt"
starknetdevnet "github.com/NethermindEth/starknet.go/devnet"
starknetutils "github.com/NethermindEth/starknet.go/utils"
Expand All @@ -18,10 +21,9 @@ import (
"github.com/stretchr/testify/require"

"github.com/smartcontractkit/chainlink-common/pkg/logger"
test_env_ctf "github.com/smartcontractkit/chainlink-testing-framework/docker/test_env"
"github.com/smartcontractkit/chainlink-testing-framework/logging"
"github.com/smartcontractkit/chainlink-testing-framework/lib/logging"
"github.com/smartcontractkit/chainlink/integration-tests/client"
"github.com/smartcontractkit/chainlink/integration-tests/docker/test_env"
test_env_integrations "github.com/smartcontractkit/chainlink/integration-tests/docker/test_env"

test_env_starknet "github.com/smartcontractkit/chainlink-starknet/integration-tests/docker/testenv"
"github.com/smartcontractkit/chainlink-starknet/integration-tests/testconfig"
Expand Down Expand Up @@ -83,7 +85,7 @@ type ChainlinkClient struct {
}

type StarknetClusterTestEnv struct {
*test_env.CLClusterTestEnv
*test_env_integrations.CLClusterTestEnv
Starknet *test_env_starknet.Starknet
Killgrave *test_env_ctf.Killgrave
}
Expand Down Expand Up @@ -154,7 +156,7 @@ func (m *OCRv2TestState) DeployCluster() {
m.Common.RPCDetails.MockServerEndpoint = m.Common.Env.URLs["qa_mock_adapter_internal"][0]
m.Common.RPCDetails.MockServerURL = "five"
} else { // Otherwise use docker
env, err := test_env.NewTestEnv()
env, err := test_env_integrations.NewTestEnv()
require.NoError(m.TestConfig.T, err)
stark := test_env_starknet.NewStarknet([]string{env.DockerNetwork.Name}, *m.Common.TestConfig.Common.DevnetImage)
err = stark.StartContainer()
Expand All @@ -170,7 +172,7 @@ func (m *OCRv2TestState) DeployCluster() {
}

// Creating docker containers
b, err := test_env.NewCLTestEnvBuilder().
b, err := test_env_integrations.NewCLTestEnvBuilder().
WithNonEVM().
WithTestInstance(m.TestConfig.T).
WithTestConfig(m.TestConfig.TestConfig).
Expand All @@ -182,6 +184,7 @@ func (m *OCRv2TestState) DeployCluster() {
require.NoError(m.TestConfig.T, err)
env, err = b.Build()
require.NoError(m.TestConfig.T, err)
env.MockAdapter.ContainerName = os.Getenv("KILLGRAVE_INTERNAL_IMAGE")
m.Clients.DockerEnv = &StarknetClusterTestEnv{
CLClusterTestEnv: env,
Starknet: stark,
Expand All @@ -205,8 +208,8 @@ func (m *OCRv2TestState) DeployCluster() {
m.Clients.ChainlinkClient.NKeys, m.TestConfig.err = m.Common.CreateNodeKeysBundle(m.Clients.ChainlinkClient.ChainlinkNodes)
require.NoError(m.TestConfig.T, m.TestConfig.err)
} else {
m.Clients.ChainlinkClient.ChainlinkNodes = m.Clients.DockerEnv.ClCluster.NodeAPIs()
m.Clients.ChainlinkClient.NKeys, m.TestConfig.err = m.Common.CreateNodeKeysBundle(m.Clients.DockerEnv.ClCluster.NodeAPIs())
m.Clients.ChainlinkClient.ChainlinkNodes = m.Clients.DockerEnv.CLClusterTestEnv.ClCluster.NodeAPIs()
m.Clients.ChainlinkClient.NKeys, m.TestConfig.err = m.Common.CreateNodeKeysBundle(m.Clients.DockerEnv.CLClusterTestEnv.ClCluster.NodeAPIs())
require.NoError(m.TestConfig.T, m.TestConfig.err)
}
lggr := logger.Nop()
Expand Down
6 changes: 3 additions & 3 deletions integration-tests/docker/testenv/stark.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import (
tc "github.com/testcontainers/testcontainers-go"
tcwait "github.com/testcontainers/testcontainers-go/wait"

"github.com/smartcontractkit/chainlink-testing-framework/docker/test_env"
"github.com/smartcontractkit/chainlink-testing-framework/logging"
"github.com/smartcontractkit/chainlink-testing-framework/utils/testcontext"
"github.com/smartcontractkit/chainlink-testing-framework/lib/docker/test_env"
"github.com/smartcontractkit/chainlink-testing-framework/lib/logging"
"github.com/smartcontractkit/chainlink-testing-framework/lib/utils/testcontext"
)

const (
Expand Down
Loading

0 comments on commit 66cca32

Please sign in to comment.