Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ci #356

Merged
merged 39 commits into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from 27 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
b462015
Adding docker support
smickovskid Feb 14, 2024
e9e6271
Rebase
smickovskid Feb 27, 2024
2b6cd76
Added scarb to Smoke tests
smickovskid Feb 27, 2024
a2c8790
Feedback from PR
smickovskid Feb 27, 2024
c14eb9f
Added inputs for cairo / scarb version
smickovskid Feb 27, 2024
af3bcaf
Scarb fix
smickovskid Feb 27, 2024
3206fcd
Added base64 override
smickovskid Feb 27, 2024
3875478
Chaning makefile for realtime logs
smickovskid Feb 27, 2024
b09ca75
Added docker creds
smickovskid Feb 27, 2024
70d8fe1
Move to toml and refactor
smickovskid Feb 27, 2024
c0a8b95
Go mod tidy
smickovskid Feb 27, 2024
25def08
Build contracts
smickovskid Feb 27, 2024
d350489
TOML feedback from Bartek
smickovskid Feb 27, 2024
cc1246a
TOML feedback from Bartek
smickovskid Feb 27, 2024
fae5cfa
Removed unneeded interfaces
smickovskid Feb 27, 2024
e849e64
Added new helm deployment method
smickovskid Feb 27, 2024
0a52985
Linting fixes
smickovskid Feb 27, 2024
e612f67
Fixing soak
smickovskid Feb 27, 2024
eefe189
Helm repo update
smickovskid Feb 27, 2024
2fb4e96
Added readme and testnet support
smickovskid Feb 28, 2024
fb7fa08
Added sepolia
smickovskid Feb 28, 2024
b78003c
txm: Increase logging
archseer Feb 28, 2024
7ea334d
relayer/pkg/chainlink/txm/txm.go: set L1Gas instead
cfal Feb 28, 2024
491bcdd
Enabled other tests as well
smickovskid Feb 29, 2024
03c4528
Improve error logging
archseer Feb 29, 2024
7c3458f
Linting fix and plugins support
smickovskid Mar 1, 2024
57cedea
scarb: OZ modified their v0.9.0 tag
archseer Mar 1, 2024
c1ca385
Adding plugins tests
smickovskid Mar 4, 2024
f34bd9d
Fixing plugins tests
smickovskid Mar 4, 2024
86db013
Added some feedback
smickovskid Mar 4, 2024
b1fc757
Feedback from PR
smickovskid Mar 5, 2024
61ce4f5
Feedback from PR
smickovskid Mar 5, 2024
aa0e2b7
Linting fixes
smickovskid Mar 5, 2024
53da150
Linting fixes
smickovskid Mar 5, 2024
ef06dc9
Linting fixes
smickovskid Mar 5, 2024
2f97df7
Yarn step added
smickovskid Mar 5, 2024
a6fd9e3
Removed plugins logic
smickovskid Mar 5, 2024
c8179ff
Added overrides to ignore
smickovskid Mar 11, 2024
a780d1a
minor: Fix broken lint
archseer Mar 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 34 additions & 2 deletions .github/workflows/integration-tests-smoke.yml
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ jobs:
TEST_DURATION: 15m
NODE_COUNT: 5
CHAINLINK_IMAGE: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com/chainlink
CHAINLINK_VERSION: starknet.${{ github.sha }}${{ matrix.image.tag-suffix }}
CHAINLINK_VERSION: starknet.${{ github.sha }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is the matrix suffix not necessary now? the push_tag on L69 still push with a matrix.image.tag-suffix?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes we need to maintain both if we want to run long running soak tests, if we only use docker there is no reliable way to run our tests for a longer period of time.

INTERNAL_DOCKER_REPO: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}.dkr.ecr.${{ secrets.QA_AWS_REGION }}.amazonaws.com
scarb_version: "v2.5.4"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 to using the install-cairo action, then we don't need scarb_version in multiple places

permissions:
checks: write
pull-requests: write
Expand All @@ -147,9 +149,39 @@ jobs:
uses: cachix/install-nix-action@29bd9290ef037a3ecbdafe83cbd2185e9dd0fa0a # v20
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Setup Scarb for Linux
id: install-scarb
shell: bash
run: |
wget https://github.com/software-mansion/scarb/releases/download/${{ env.scarb_version }}/scarb-${{ env.scarb_version }}-x86_64-unknown-linux-musl.tar.gz
tar -xvzf scarb-${{ env.scarb_version }}-x86_64-unknown-linux-musl.tar.gz
mv -vf scarb-${{ env.scarb_version }}-x86_64-unknown-linux-musl scarb-build
echo "$GITHUB_WORKSPACE/scarb-build/bin" >> $GITHUB_PATH
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just use the action we use on all the other workflows

- name: Install Cairo
uses: ./.github/actions/install-cairo

- name: Build contracts
run: |
cd contracts && scarb --profile release build
- name: Generate config overrides
run: | # https://github.com/smartcontractkit/chainlink-testing-framework/blob/main/config/README.md
cat << EOF > config.toml
[ChainlinkImage]
image="${{ env.CHAINLINK_IMAGE }}"
version="${{ env.CHAINLINK_VERSION }}"
[Network]
selected_networks=["SIMULATED"]
[Common]
internal_docker_repo = "${{ env.INTERNAL_DOCKER_REPO }}"
stateful_db = false
EOF
# shellcheck disable=SC2002
BASE64_CONFIG_OVERRIDE=$(cat config.toml | base64 -w 0)
# shellcheck disable=SC2086
echo ::add-mask::$BASE64_CONFIG_OVERRIDE
# 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@ea889b3133bd7f16ab19ba4ba130de5d9162c669 # v2.3.4
with:
aws_registries: ${{ secrets.QA_AWS_ACCOUNT_NUMBER }}
test_command_to_run: nix develop -c helm repo update && make test-integration-smoke-ci
test_download_vendor_packages_command: cd integration-tests && nix develop -c go mod download
cl_repo: ${{ env.CL_ECR }}
Expand All @@ -159,4 +191,4 @@ jobs:
QA_AWS_REGION: ${{ secrets.QA_AWS_REGION }}
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
artifacts_location: /home/runner/work/chainlink-starknet/chainlink-starknet/integration-tests/smoke/logs
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -166,3 +166,4 @@ ztarrepo.tar.gz
eslint-report.json
.run.id
.local-mock-server
overrides.toml
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ test-integration-smoke: test-integration-prep
.PHONY: test-integration-smoke-ci
test-integration-smoke-ci:
cd integration-tests/ && \
go test --timeout=2h -v -count=1 -json ./smoke 2>&1 | tee /tmp/gotest.log | gotestfmt
go test --timeout=2h -v -count=1 -json ./smoke

.PHONY: test-integration-soak
test-integration-soak: test-integration-prep
Expand Down
1 change: 1 addition & 0 deletions contracts/.tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
scarb 2.5.4
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's already a .tool-versions in the root directory that specifies this

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both removed

2 changes: 1 addition & 1 deletion contracts/Scarb.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ dependencies = [
[[package]]
name = "openzeppelin"
version = "0.9.0"
source = "git+https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.9.0#861fc416f87addbe23a3b47f9d19ab27c10d5dc8"
source = "git+https://github.com/OpenZeppelin/cairo-contracts.git?tag=v0.9.0#364db5b1aecc1335d2e65db887291d19aa28937d"
Empty file added integration-tests/.root_dir
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does this file do?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is related to the testconfig and TOML changes, that is how the logic knows where to look for the toml configurations.

Empty file.
46 changes: 18 additions & 28 deletions integration-tests/README.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,28 @@
# Local e2e testing
## Integration tests - HOWTO

Make sure to have `psql` installed locally. We use it to create a new database for each node.
### Prerequisites
1. `cd contracts && scarb --profile release build`
2. `yarn install`
3. `yarn build`

Create a new network for containers (only needs to be done once). A custom network allows containers to DNS resolve each other using container names.
#### TOML preparation
The integration tests are using TOML as the configuration input. The logic and parsing is located under [Test config](./testconfig)

```
docker network create chainlink
```
By default, the tests will be running with the default config set in [default.toml](./testconfig/default.toml). This configuration is set to run on devnet with local docker.

Build a custom core image with starknet relayer bumped to some commit.
Fields in the default toml can be overriden by creating an `overrides.toml`file. Any values specified here take precedence and will be overwritten if they overlap with `default.toml`.

```
cd ../core
go get github.com/smartcontractkit/chainlink-starknet/relayer@<MY COMMIT HERE>
docker build . -t smartcontract/chainlink:starknet -f ./core/chainlink.Dockerfile
```
##### Testnet runs
In order to run the tests on Testnet, additional variables need to be specified in the TOML, these would also be pointed out if `network = "testnet"` is set. The additional variables are:

Compile contracts and gauntlet:
- `l2_rpc_url` - L2 RPC url
- `account` - Account address on L2
- `private_key` - Private key for L2 account

```
yarn build
cd contracts
scarb --profile release build
```
##### Running in k8s

Run the tests!
Set `inside_k8 = true` under `[Common]`.

```
cd integration-tests
go test -count 1 -v -timeout 30m --run OCRBasic ./smoke
```
#### Run tests

Use `something.down.sh` scripts to teardown everything afterwards if the tests don't properly clean up.

# Old docs

For more information, see the [Chainlink Starknet Documentation | Integration Tests](../docs/integration-tests).
`cd integration-tests && go test --timeout=2h -v -count=1 -json ./smoke`
Loading
Loading