Skip to content

Commit

Permalink
Merge WASP library (#1082)
Browse files Browse the repository at this point in the history
* init

* change mod name, add CI

* try to trigger

* commit go.sum

* fix lint

* move wasp to the root folder

* fix lint

* fix lint again

* link readmes

* change workflow to paths

* move back to dorny for required checks

* fix readme lint

* try trigger CI
  • Loading branch information
skudasov authored Aug 22, 2024
1 parent 2738403 commit 34d49f1
Show file tree
Hide file tree
Showing 91 changed files with 12,247 additions and 2 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/wasp-lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: WASP Lint
on:
push:
permissions:
contents: read
jobs:
golangci:
defaults:
run:
working-directory: wasp
name: lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
src:
- 'wasp/**'
- uses: cachix/install-nix-action@v18
if: steps.changes.outputs.src == 'true'
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Run lint
if: steps.changes.outputs.src == 'true'
run: |-
nix develop -c make lint
31 changes: 31 additions & 0 deletions .github/workflows/wasp-test-e2e.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: WASP E2E tests
on: [push]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
defaults:
run:
working-directory: wasp
env:
LOKI_TENANT_ID: ${{ secrets.LOKI_TENANT_ID }}
LOKI_BASIC_AUTH: ${{ secrets.LOKI_BASIC_AUTH }}
LOKI_URL: ${{ secrets.LOKI_URL }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
src:
- 'wasp/**'
- uses: cachix/install-nix-action@v18
if: steps.changes.outputs.src == 'true'
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Run tests
if: steps.changes.outputs.src == 'true'
run: |-
nix develop -c make test_loki
27 changes: 27 additions & 0 deletions .github/workflows/wasp-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: WASP Go Tests
on: [push]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
defaults:
run:
working-directory: wasp
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dorny/paths-filter@v3
id: changes
with:
filters: |
src:
- 'wasp/**'
- uses: cachix/install-nix-action@v18
if: steps.changes.outputs.src == 'true'
with:
nix_path: nixpkgs=channel:nixos-unstable
- name: Run tests
if: steps.changes.outputs.src == 'true'
run: |-
nix develop -c make test_race
2 changes: 2 additions & 0 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,5 @@ issues:
- contracts/ethereum
- examples
- imports
- wasp/examples/*
- k8s
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ charts/**/README.md
k8s-test-runner/chart/**/*.yaml
node_modules/
index.yaml
wasp/**
12 changes: 11 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,20 @@

</div>

The Chainlink Testing Framework 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.
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.

If you're looking to implement a new chain integration for the testing framework, head over to the [blockchain](./blockchain/) directory for more info.

# Content

1. [Libraries](#libraries)

## Libraries

CTF contains a set of useful libraries:

- [WASP](wasp/README.md) - Scalable protocol-agnostic load testing library for `Go`

## k8s package

We have a k8s package we are using in tests, it provides:
Expand Down
10 changes: 9 additions & 1 deletion _typos.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,10 @@
[files]
extend-exclude = ["**/go.mod", "**/go.sum", "charts", "**/*.tgz", "**/*.png"]
extend-exclude = [
"**/go.mod",
"**/go.sum",
"charts",
"**/*.tgz",
"**/*.png",
"wasp/HOW_IT_WORKS.md",
"wasp/dashboard/**"
]
1 change: 1 addition & 0 deletions wasp/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.git/
7 changes: 7 additions & 0 deletions wasp/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export LOKI_TOKEN=
export LOKI_URL=http://localhost:3030/loki/api/v1/push
export GRAFANA_URL=http://localhost:3000
export GRAFANA_TOKEN=
export DATA_SOURCE_NAME=Loki
export DASHBOARD_FOLDER=LoadTests
export DASHBOARD_NAME=Wasp
7 changes: 7 additions & 0 deletions wasp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
bin/
.vscode/
.idea/
.direnv/

k3dvolume/
.private.env
15 changes: 15 additions & 0 deletions wasp/.golangci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
run:
timeout: 5m
issues:
exclude-use-default: false
exclude-dirs:
- bin
- imports
- examples/*
linters-settings:
revive:
rules:
- name: exported
severity: warning
- name: dot-imports
disabled: true
1 change: 1 addition & 0 deletions wasp/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* @smartcontractkit/test-tooling-team
22 changes: 22 additions & 0 deletions wasp/DockerfileWasp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Example DockerfileWasp for k8s run
# Builds all the tests in some directory that must have go.mod
# All tests are built as separate binaries with name "module.test"
FROM golang:1.21 as build
ARG TESTS_ROOT

WORKDIR /go/src
COPY . .

RUN echo $(pwd)
RUN ls -lah
WORKDIR /go/src/${TESTS_ROOT}
RUN echo $(pwd)
RUN ls -lah
RUN cd /go/src/${TESTS_ROOT} && CGO_ENABLED=0 go test -c ./...

FROM debian
ARG TESTS_ROOT

COPY --from=build /go/src/${TESTS_ROOT} .
RUN apt-get update && apt-get install -y ca-certificates
ENTRYPOINT /bin/bash
31 changes: 31 additions & 0 deletions wasp/DockerfileWasp.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
.git-together
.DS_Store
.envrc
*.log
node_modules/
**/node_modules/
vendor/
tmp/

contracts/node_modules
examples/

integration/
integration-scripts/

tools/gethnet/datadir/geth
tools/clroot/db.bolt
tools/clroot/*.log
tools/clroot/tempkeys

core/sgx/target/

core/*.Dockerfile
chainlink

# codeship
codeship-*.yml
*.aes
dockercfg
credentials.env
gcr_creds.env
Loading

0 comments on commit 34d49f1

Please sign in to comment.