Skip to content

Commit e032345

Browse files
committed
Merge
2 parents babd646 + bc5f730 commit e032345

File tree

267 files changed

+14537
-6391
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

267 files changed

+14537
-6391
lines changed

.github/workflows/docs.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: GH Pages Deploy (Docs, mdbook)
2+
3+
4+
on:
5+
push:
6+
branches:
7+
- main
8+
tags:
9+
- '*'
10+
11+
jobs:
12+
build-deploy:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
17+
with:
18+
fetch-depth: 0 # Fetch all history for all tags
19+
20+
- name: Setup mdBook
21+
uses: peaceiris/actions-mdbook@v1
22+
with:
23+
mdbook-version: '0.4.40'
24+
25+
- name: Install Pre-processors
26+
run: |
27+
cargo install mdbook-alerts
28+
cargo install mdbook-cmdrun
29+
30+
- name: Build
31+
working-directory: book
32+
run: |
33+
mdbook build
34+
35+
- name: Deploy to GitHub Pages
36+
uses: peaceiris/actions-gh-pages@v3
37+
with:
38+
github_token: ${{ secrets.GITHUB_TOKEN }}
39+
publish_dir: book
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: Framework Golden Tests Examples
2+
on:
3+
push:
4+
5+
jobs:
6+
test:
7+
defaults:
8+
run:
9+
working-directory: framework/examples/myproject
10+
env:
11+
LOKI_TENANT_ID: promtail
12+
LOKI_URL: http://localhost:3030/loki/api/v1/push
13+
runs-on: ubuntu-latest
14+
permissions:
15+
id-token: write
16+
contents: read
17+
strategy:
18+
fail-fast: false
19+
matrix:
20+
test:
21+
- name: TestSmoke
22+
config: smoke.toml
23+
count: 1
24+
timeout: 10m
25+
- name: TestLoad
26+
config: load.toml
27+
count: 1
28+
timeout: 10m
29+
- name: TestChaos
30+
config: chaos.toml
31+
count: 1
32+
timeout: 10m
33+
- name: TestReload
34+
config: reload.toml
35+
count: 1
36+
timeout: 10m
37+
steps:
38+
- name: Checkout repo
39+
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
40+
- name: Configure AWS credentials using OIDC
41+
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
42+
with:
43+
role-to-assume: ${{ secrets.PUBLIC_AWS_ECR_ROLE }}
44+
aws-region: us-east-1
45+
- name: Authenticate to ECR Public
46+
id: login-ecr-public
47+
uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 # v2.0.1
48+
with:
49+
registry-type: public
50+
- name: Check for changes in Framework
51+
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
52+
id: changes
53+
with:
54+
filters: |
55+
src:
56+
- 'framework/**'
57+
- name: Set up Go
58+
uses: actions/setup-go@v4
59+
with:
60+
go-version: 1.22.8
61+
- name: Cache Go modules
62+
uses: actions/cache@v3
63+
with:
64+
path: |
65+
~/.cache/go-build
66+
~/go/pkg/mod
67+
key: go-modules-${{ hashFiles('framework/examples/myproject/go.sum') }}-${{ runner.os }}-framework-golden-examples
68+
restore-keys: |
69+
go-modules-${{ runner.os }}-framework-golden-examples
70+
go-modules-${{ runner.os }}
71+
- name: Install dependencies
72+
run: go mod download
73+
- name: Run Docker Component Tests
74+
if: steps.changes.outputs.src == 'true'
75+
env:
76+
CTF_CONFIGS: ${{ matrix.test.config }}
77+
run: |
78+
go test -timeout ${{ matrix.test.timeout }} -v -count ${{ matrix.test.count }} -run ${{ matrix.test.name }}

.github/workflows/framework.yml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Framework Docker Component Tests
2+
on:
3+
push:
4+
concurrency:
5+
group: ${{ github.workflow }}-${{ github.ref }}-framework
6+
cancel-in-progress: true
7+
jobs:
8+
test:
9+
defaults:
10+
run:
11+
working-directory: framework
12+
runs-on: ubuntu-latest
13+
permissions:
14+
id-token: write
15+
contents: read
16+
steps:
17+
- name: Checkout repo
18+
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
19+
- name: Configure AWS credentials using OIDC
20+
uses: aws-actions/configure-aws-credentials@e3dd6a429d7300a6a4c196c26e071d42e0343502 # v4.0.2
21+
with:
22+
role-to-assume: ${{ secrets.PUBLIC_AWS_ECR_ROLE }}
23+
aws-region: us-east-1
24+
- name: Authenticate to ECR Public
25+
id: login-ecr-public
26+
uses: aws-actions/amazon-ecr-login@062b18b96a7aff071d4dc91bc00c4c1a7945b076 # v2.0.1
27+
with:
28+
registry-type: public
29+
- name: Check for changes in Framework
30+
uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2
31+
id: changes
32+
with:
33+
filters: |
34+
src:
35+
- 'framework/**'
36+
- name: Set up Go
37+
uses: actions/setup-go@v4
38+
with:
39+
go-version: 1.22.8
40+
- name: Cache Go modules
41+
uses: actions/cache@v3
42+
with:
43+
path: |
44+
~/.cache/go-build
45+
~/go/pkg/mod
46+
key: go-modules-${{ hashFiles('**/go.sum') }}-${{ runner.os }}-framework
47+
restore-keys: |
48+
go-modules-${{ hashFiles('**/go.sum') }}-${{ runner.os }}-framework
49+
- name: Install dependencies
50+
run: go mod download
51+
- name: Run Docker Component Tests
52+
if: steps.changes.outputs.src == 'true'
53+
run: |
54+
go test -timeout 5m -v -count 1 -run TestDocker ./...

.github/workflows/k8s-publish-test-base-image.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
tags:
55
# we only need base image for k8s based tests
66
- 'lib/v*'
7+
workflow_dispatch:
78

89
jobs:
910
publish_test_base_image:

.github/workflows/release-go-module.yml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ name: Release Go module
66
on:
77
push:
88
tags:
9-
- '*/v*.*.*' # Trigger only on tags with the format $package/vX.X.X
10-
- '*/*/v*.*.*' # Trigger only on tags with the format $package/$subpackage/vX.X.X
9+
- '**/v*.*.*' # Trigger on all tags ending with /vX.X.X
1110

1211
permissions:
1312
contents: write
@@ -31,8 +30,8 @@ jobs:
3130
id: extract_package_name
3231
run: |
3332
TAG_REF="${GITHUB_REF#refs/tags/}"
34-
PACKAGE_NAME=$(echo "$TAG_REF" | cut -d'/' -f1)
35-
VERSION=$(echo "$TAG_REF" | cut -d'/' -f2)
33+
PACKAGE_NAME="${TAG_REF%/*}"
34+
VERSION="${TAG_REF##*/}"
3635
echo "Tag Reference: $TAG_REF"
3736
echo "Package Name: $PACKAGE_NAME"
3837
echo "Version: $VERSION"
@@ -42,11 +41,6 @@ jobs:
4241
- name: Find Last Tag for Package and Generate Release Notes
4342
id: generate_release_notes
4443
run: |
45-
# Extract the package name and version from the tag
46-
TAG_REF="${GITHUB_REF#refs/tags/}"
47-
PACKAGE_NAME=$(echo "$TAG_REF" | cut -d'/' -f1)
48-
VERSION=$(echo "$TAG_REF" | cut -d'/' -f2)
49-
5044
# Find the latest tag for the same package that is not the current tag
5145
LAST_TAG=$(git describe --abbrev=0 --always --match "$PACKAGE_NAME/v*" --tags $(git rev-list --tags --skip=1 --max-count=1))
5246
echo "Last tag: ${LAST_TAG}"
@@ -57,7 +51,7 @@ jobs:
5751
fi
5852
5953
# Extract the version part of the last tag
60-
LAST_TAG_VERSION=$(echo "$LAST_TAG" | cut -d'/' -f2)
54+
LAST_TAG_VERSION="${LAST_TAG##*/}"
6155
echo "Last tag version: $LAST_TAG_VERSION"
6256
echo "LAST_TAG_VERSION=${LAST_TAG_VERSION}" >> "$GITHUB_ENV"
6357
@@ -124,14 +118,21 @@ jobs:
124118
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
125119
run: |
126120
sudo apt-get install -y gh
127-
gh release create "${{ env.PACKAGE_NAME }}-${{ env.VERSION }}" --title "${{ env.PACKAGE_NAME }} ${{ env.VERSION }}" --notes "${{ env.FULL_RELEASE_NOTES }}" || true
121+
gh release create "${{ env.PACKAGE_NAME }}/${{ env.VERSION }}" --title "${{ env.PACKAGE_NAME }}/${{ env.VERSION }}" --notes "${{ env.FULL_RELEASE_NOTES }}" || true
128122
- name: Check if 'cmd' directory exists and set environment variable
129123
run: |
130124
if [ -f "$GITHUB_WORKSPACE/${{ env.PACKAGE_NAME }}/cmd/main.go" ]; then
131125
echo "CMD_ENTRYPOINT_EXISTS=true" >> "$GITHUB_ENV"
132126
else
133127
echo "CMD_ENTRYPOINT_EXISTS=false" >> "$GITHUB_ENV"
134128
fi
129+
- name: Set binary name based on PACKAGE_NAME
130+
run: |
131+
if [ "${{ env.PACKAGE_NAME }}" == "framework" ]; then
132+
echo "BINARY_NAME=ctf" >> $GITHUB_ENV
133+
else
134+
echo "BINARY_NAME=${{ env.PACKAGE_NAME }}" >> $GITHUB_ENV
135+
fi
135136
- name: Build binary release
136137
uses: wangyoucao577/go-release-action@v1
137138
if: env.CMD_ENTRYPOINT_EXISTS == 'true'
@@ -140,8 +141,8 @@ jobs:
140141
goversion: '1.22.6'
141142
goos: ${{ matrix.platform }}
142143
goarch: ${{ matrix.goarch }}
143-
binary_name: ${{ env.PACKAGE_NAME }}
144+
binary_name: ${{ env.BINARY_NAME }}
144145
release_name: ${{ env.PACKAGE_NAME }}
145-
release_tag: ${{ env.PACKAGE_NAME}}-${{ env.VERSION }}
146+
release_tag: ${{ env.PACKAGE_NAME}}/${{ env.VERSION }}
146147
project_path: ${{ env.PACKAGE_NAME }}/cmd
147148
asset_name: ${{ env.PACKAGE_NAME }}-${{ env.VERSION }}-${{ matrix.platform }}-${{ matrix.goarch }}

.github/workflows/test.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ jobs:
2222
path: ./tools/ghlatestreleasechecker/
2323
- name: asciitable
2424
path: ./tools/asciitable/
25+
- name: flakeguard
26+
path: ./tools/flakeguard/
2527
- name: workflowresultparser
2628
path: ./tools/workflowresultparser/
2729
runs-on: ubuntu-latest

.github/workflows/update-internal-mirrors.yaml

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,39 +20,39 @@ jobs:
2020
mirror:
2121
# note library just means it is part of the official library
2222
- name: library/postgres
23-
expression: '^[0-9]+\.[0-9]+$'
23+
expression: '^v?[0-9]+\.[0-9]+$'
2424
- name: ethereum/client-go
25-
expression: '^(alltools-v|v)[0-9]\.[0-9]+\.[0-9]+$'
25+
expression: '^(alltools-v|v)?[0-9]\.[0-9]+\.[0-9]+$'
2626
- name: friendsofgo/killgrave
2727
expression: '^v?[0-9]+\.[0-9]+\.[0-9]+$'
2828
- name: mockserver/mockserver
29-
expression: '^[0-9]+\.[0-9]+\.[0-9]+$'
29+
expression: '^v?[0-9]+\.[0-9]+\.[0-9]+$'
3030
- name: testcontainers/ryuk
31-
expression: '^[0-9]+\.[0-9]+\.[0-9]+$'
31+
expression: '^v?[0-9]+\.[0-9]+\.[0-9]+$'
3232
- name: confluentinc/cp-kafka
33-
expression: '^[0-9]+\.[0-9]+\.[0-9]+$'
33+
expression: '^v?[0-9]+\.[0-9]+\.[0-9]+$'
3434
- name: confluentinc/cp-schema-registry
35-
expression: '^[0-9]+\.[0-9]+\.[0-9]+$'
35+
expression: '^v?[0-9]+\.[0-9]+\.[0-9]+$'
3636
- name: confluentinc/cp-zookeeper
37-
expression: '^[0-9]+\.[0-9]+\.[0-9]+$'
37+
expression: '^v?[0-9]+\.[0-9]+\.[0-9]+$'
3838
- name: hyperledger/besu
39-
expression: '^[0-9]+\.[0-9]+(\.[0-9]+)?$'
39+
expression: '^v?[0-9]+\.[0-9]+(\.[0-9]+)?$'
4040
page_size: 300
4141
- name: thorax/erigon
42-
expression: '^v[0-9]+\.[0-9]+\.[0-9]+$'
42+
expression: '^v?[0-9]+\.[0-9]+\.[0-9]+$'
4343
- name: nethermind/nethermind
44-
expression: '^[0-9]+\.[0-9]+\.[0-9]+$'
44+
expression: '^v?[0-9]+\.[0-9]+\.[0-9]+$'
4545
- name: ghcr.io/paradigmxyz/reth
46-
expression: '^v[0-9]+\.[0-9]+\.[0-9]+$'
46+
expression: '^v?[0-9]+\.[0-9]+\.[0-9]+$'
4747
- name: wiremock/wiremock
48-
expression: '^[0-9]+\.[0-9]+\.[0-9]+$'
48+
expression: '^v?[0-9]+\.[0-9]+\.[0-9]+$'
4949
# disabled until gcloud auth is added
5050
# - name: gcr.io/prysmaticlabs/prysm/beacon-chain
5151
# expression: '^v[0-9]+\.[0-9]+\.[0-9]+$'
5252
# - name: gcr.io/prysmaticlabs/prysm/validator
5353
# expression: '^v[0-9]+\.[0-9]+\.[0-9]+$'
5454
- name: tofelb/ethereum-genesis-generator
55-
expression: '^[0-9]+\.[0-9]+\.[0-9]+(\-slots\-per\-epoch)?'
55+
expression: '^v?[0-9]+\.[0-9]+\.[0-9]+(\-slots\-per\-epoch)?'
5656
# This one only has latest tag, probably only want to update it when we know for sure it's a new version we want
5757
# - name: protolambda/eth2-val-tools
5858
# expression: 'latest'

README.md

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,21 @@
11
<div align="center">
22

33
# Chainlink Testing Framework
4+
[![Documentation](https://img.shields.io/badge/Documentation-MDBook-blue?style=for-the-badge)](https://smartcontractkit.github.io/chainlink-testing-framework/overview.html)
45

5-
[![Main branch breaking changes check](https://github.com/smartcontractkit/chainlink-testing-framework/actions/workflows/rc-breaking-changes.yaml/badge.svg)](https://github.com/smartcontractkit/chainlink-testing-framework/actions/workflows/rc-breaking-changes.yaml)
6+
[//]: # ([![Main branch breaking changes check]&#40;https://github.com/smartcontractkit/chainlink-testing-framework/actions/workflows/rc-breaking-changes.yaml/badge.svg&#41;]&#40;https://github.com/smartcontractkit/chainlink-testing-framework/actions/workflows/rc-breaking-changes.yaml&#41;)
7+
[![Framework tag](https://img.shields.io/github/v/tag/smartcontractkit/chainlink-testing-framework?filter=%2Aframework%2A)](https://github.com/smartcontractkit/chainlink-testing-framework/tags)
68
[![Lib tag](https://img.shields.io/github/v/tag/smartcontractkit/chainlink-testing-framework?filter=%2Alib%2A)](https://github.com/smartcontractkit/chainlink-testing-framework/tags)
79
[![WASP tag](https://img.shields.io/github/v/tag/smartcontractkit/chainlink-testing-framework?filter=%2Awasp%2A)](https://github.com/smartcontractkit/chainlink-testing-framework/tags)
810
[![Seth tag](https://img.shields.io/github/v/tag/smartcontractkit/chainlink-testing-framework?filter=%2Aseth%2A)](https://github.com/smartcontractkit/chainlink-testing-framework/tags)
911
[![Havoc tag](https://img.shields.io/github/v/tag/smartcontractkit/chainlink-testing-framework?filter=%2Ahavoc%2A)](https://github.com/smartcontractkit/chainlink-testing-framework/tags)
12+
13+
[![Tests](https://github.com/smartcontractkit/chainlink-testing-framework/actions/workflows/test.yaml/badge.svg)](https://github.com/smartcontractkit/chainlink-testing-framework/actions/workflows/test.yaml)
14+
[![Lints](https://github.com/smartcontractkit/chainlink-testing-framework/actions/workflows/lint.yaml/badge.svg)](https://github.com/smartcontractkit/chainlink-testing-framework/actions/workflows/lint.yaml)
15+
1016
[![Go Report Card](https://goreportcard.com/badge/github.com/smartcontractkit/chainlink-testing-framework)](https://goreportcard.com/report/github.com/smartcontractkit/chainlink-testing-framework)
11-
[![Go Reference](https://pkg.go.dev/badge/github.com/smartcontractkit/chainlink-testing-framework.svg)](https://pkg.go.dev/github.com/smartcontractkit/chainlink-testing-framework/lib)
1217
![Go Version](https://img.shields.io/github/go-mod/go-version/smartcontractkit/chainlink-testing-framework?filename=./lib/go.mod)
13-
![Tests](https://github.com/smartcontractkit/chainlink-testing-framework/actions/workflows/test.yaml/badge.svg)
14-
![Lint](https://github.com/smartcontractkit/chainlink-testing-framework/actions/workflows/lint.yaml/badge.svg)
1518
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
16-
1719
</div>
1820

19-
The Chainlink Testing Framework (CTF) is a blockchain development framework written in Go. Its primary purpose is to help chainlink developers create extensive integration, e2e, performance, and chaos tests to ensure the stability of the chainlink project. It can also be helpful to those who just want to use chainlink oracles in their projects to help test their contracts, or even for those that aren't using chainlink.
20-
21-
If you're looking to implement a new chain integration for the testing framework, head over to the [blockchain](./blockchain/) directory for more info.
22-
23-
# Content
24-
25-
1. [Libraries](#libraries)
26-
2. [Releasing](#releasing)
27-
28-
## Libraries
29-
30-
CTF monorepository contains a set of libraries:
31-
32-
- [Harness](lib/README.md) - Library to interact with different blockchains, create CL node jobs and use k8s and docker.
33-
- [WASP](wasp/README.md) - Scalable protocol-agnostic load testing library for `Go`
34-
- [Havoc](havoc/README.md) - Chaos testing library
35-
- [Seth](seth/README.md) - Ethereum client library with transaction tracing and gas bumping
36-
37-
## Releasing
38-
39-
We follow [SemVer](https://semver.org/) and follow best Go practices for releasing our modules, please follow the [instruction](RELEASE.md)
21+
The Chainlink Testing Framework (CTF) is a blockchain development framework written in Go. Its primary purpose is to help chainlink developers create extensive integration, e2e, performance, and chaos tests to ensure the stability of the chainlink project. It can also be helpful to those who just want to use chainlink oracles in their projects to help test their contracts, or even for those that aren't using chainlink.

book/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.PHONY: run
2+
run:
3+
mdbook serve -p 9999

book/README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## MDBook
2+
Install [mdbook](https://github.com/rust-lang/mdBook)
3+
```
4+
cargo install mdbook && \
5+
cargo install mdbook-alerts && \
6+
cargo install mdbook-cmdrun
7+
```
8+
9+
Run it locally
10+
```
11+
make run
12+
```
13+
Open your browser [here](http://localhost:9999/)
14+
15+
GitHub hosted [version](https://smartcontractkit.github.io/chainlink-testing-framework/overview.html)

0 commit comments

Comments
 (0)