-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #71 from smartcontractkit/update_image_CI
Fix relay/contracts changes
- Loading branch information
Showing
20 changed files
with
799 additions
and
199 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
name: chaos | ||
on: | ||
schedule: | ||
- cron: '0 */3 * * *' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Cache cargo registry | ||
uses: actions/[email protected] | ||
with: | ||
path: ~/.cargo/registry | ||
key: ${{ runner.os }}-v2-cargo-registry-${{ hashFiles('**/Cargo.lock') }} | ||
- name: Cache cargo index | ||
uses: actions/[email protected] | ||
with: | ||
path: ~/.cargo/git | ||
key: ${{ runner.os }}-v2-cargo-index-${{ hashFiles('**/Cargo.lock') }} | ||
- name: Build Artifacts | ||
run: | | ||
docker run --rm -v "$(pwd)":/code \ | ||
--mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \ | ||
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ | ||
cosmwasm/workspace-optimizer:0.12.4 | ||
- uses: actions/upload-artifact@master | ||
with: | ||
name: artifacts | ||
path: artifacts | ||
chaos: | ||
runs-on: ubuntu-latest | ||
needs: build | ||
env: | ||
CGO_ENABLED: 1 | ||
steps: | ||
- name: Checkout the repo | ||
uses: actions/checkout@v2 | ||
- name: Setup go | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: 1.17 | ||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.QA_AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.QA_AWS_SECRET_KEY }} | ||
aws-region: ${{ secrets.QA_AWS_REGION }} | ||
role-to-assume: ${{ secrets.QA_AWS_ROLE_TO_ASSUME }} | ||
role-duration-seconds: 3600 | ||
- name: Set Kubernetes Context | ||
uses: azure/k8s-set-context@v1 | ||
with: | ||
method: kubeconfig | ||
kubeconfig: ${{ secrets.QA_KUBECONFIG }} | ||
- name: Cache Vendor Packages | ||
uses: actions/cache@v2 | ||
id: cache-packages | ||
with: | ||
path: | | ||
~/.cache/go-build | ||
~/go/pkg/mod | ||
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }} | ||
restore-keys: | | ||
${{ runner.os }}-go- | ||
- name: Download Go Vendor Packages | ||
if: steps.cache-packages.outputs.cache-hit != 'true' | ||
run: go mod download | ||
- name: Install Ginkgo CLI | ||
run: | | ||
go get github.com/onsi/ginkgo/v2/ginkgo/[email protected] | ||
go get github.com/onsi/ginkgo/v2/ginkgo/[email protected] | ||
go get github.com/onsi/ginkgo/v2/ginkgo/[email protected] | ||
go install github.com/onsi/ginkgo/v2/ginkgo | ||
- uses: actions/download-artifact@master | ||
with: | ||
name: artifacts | ||
path: artifacts | ||
- name: Run Tests | ||
env: | ||
SELECTED_NETWORKS: localterra | ||
NETWORK_SETTINGS: /home/runner/work/chainlink-terra/chainlink-terra/tests/e2e/networks.yaml | ||
run: | | ||
export PATH=$PATH:$(go env GOPATH)/bin | ||
ginkgo tests/e2e/chaos | ||
- name: Publish Test Results | ||
uses: mikepenz/action-junit-report@v2 | ||
if: always() | ||
with: | ||
report_paths: "./tests-chaos-report.xml" | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
check_name: Chaos Test Results | ||
- name: Publish Artifacts | ||
if: failure() | ||
uses: actions/[email protected] | ||
with: | ||
name: test-logs | ||
path: /home/runner/work/chainlink-terra/chainlink-terra/tests/e2e/logs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -93,4 +93,4 @@ jobs: | |
uses: actions/[email protected] | ||
with: | ||
name: test-logs | ||
path: ./logs | ||
path: /home/runner/work/chainlink-terra/chainlink-terra/tests/e2e/logs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
### Persistent K8s env chaos test run | ||
In order to deploy contracts and env only once and then run chaos suite: | ||
1. Paste version of image you want to run in `chainlink-relay-terra.yaml` | ||
2. Spin up an environment | ||
```shell | ||
envcli new --preset chainlink-relay-terra.yaml | ||
``` | ||
3. Run initial test | ||
```shell | ||
SELECTED_NETWORKS="localterra" NETWORK_SETTINGS="${YOUR_NETWORKS_FILE}" ENVIRONMENT_FILE="${YOUR_ENV_YAML}" ginkgo tests/e2e/chaos | ||
``` | ||
4. Set `contracts_deployed: true` in `networks.yaml` | ||
5. Run tests again |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
namespace_prefix: chainlink | ||
charts: | ||
localterra: | ||
index: 1 | ||
mockserver-config: | ||
index: 2 | ||
mockserver: | ||
index: 3 | ||
chainlink: | ||
index: 4 | ||
values: | ||
replicas: 5 | ||
chainlink: | ||
image: | ||
image: "public.ecr.aws/z0b1w9r9/chainlink" | ||
version: "candidate-develop-terr-qa-test-feb-02.ea461a08f1927b99f37fac4b078cd4b42a88995a" | ||
db: | ||
stateful: true | ||
capacity: 2Gi | ||
env: | ||
EVM_ENABLED: "false" | ||
EVM_RPC_ENABLED: "false" | ||
TERRA_ENABLED: "true" | ||
eth_disabled: "true" | ||
CHAINLINK_DEV: "true" | ||
USE_LEGACY_ETH_ENV_VARS: "true" | ||
feature_external_initiators: "true" | ||
FEATURE_OFFCHAIN_REPORTING2: "true" | ||
P2P_NETWORKING_STACK: "V2" | ||
P2PV2_LISTEN_ADDRESSES: "0.0.0.0:6690" | ||
P2PV2_DELTA_DIAL: "5s" | ||
P2PV2_DELTA_RECONCILE: "5s" | ||
p2p_listen_port: "0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package chaos | ||
|
||
import ( | ||
"time" | ||
|
||
. "github.com/onsi/ginkgo/v2" | ||
. "github.com/onsi/gomega" | ||
tc "github.com/smartcontractkit/chainlink-terra/tests/e2e/common" | ||
"github.com/smartcontractkit/chainlink-terra/tests/e2e/smoke/common" | ||
"github.com/smartcontractkit/integrations-framework/actions" | ||
) | ||
|
||
var _ = Describe("Solana chaos suite", func() { | ||
var state = &common.OCRv2State{} | ||
BeforeEach(func() { | ||
By("Deploying OCRv2 cluster", func() { | ||
state.DeployCluster(5, true) | ||
state.LabelChaosGroups() | ||
tc.ImitateSource(state.MockServer, common.SourceChangeInterval, 2, 10) | ||
}) | ||
}) | ||
It("Can tolerate chaos experiments", func() { | ||
By("Stable and working", func() { | ||
state.ValidateRoundsAfter(time.Now(), 10) | ||
}) | ||
By("Can work with faulty nodes offline", func() { | ||
state.CanWorkWithFaultyNodesOffline() | ||
}) | ||
By("Can't work when more than faulty nodes are offline", func() { | ||
state.CantWorkWithMoreThanFaultyNodesSplit() | ||
}) | ||
By("Can't work with two parts network split, restored after", func() { | ||
state.RestoredAfterNetworkSplit() | ||
}) | ||
By("Can recover from yellow group loss connection to validator", func() { | ||
state.CanWorkYellowGroupNoValidatorConnection() | ||
}) | ||
By("Can recover after all nodes lost connection to validator", func() { | ||
state.CanRecoverAllNodesValidatorConnectionLoss() | ||
}) | ||
By("Can work after all nodes restarted", func() { | ||
state.CanWorkAfterAllNodesRestarted() | ||
}) | ||
}) | ||
AfterEach(func() { | ||
By("Tearing down the environment", func() { | ||
err := actions.TeardownSuite(state.Env, nil, "logs") | ||
Expect(err).ShouldNot(HaveOccurred()) | ||
}) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package chaos_test | ||
|
||
import ( | ||
"github.com/smartcontractkit/chainlink-terra/tests/e2e/utils" | ||
"testing" | ||
|
||
. "github.com/onsi/ginkgo/v2" | ||
) | ||
|
||
func Test_Suite(t *testing.T) { | ||
utils.GinkgoSuite() | ||
RunSpecs(t, "Chaos") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.