Skip to content

Commit

Permalink
code review changes + renaming of chainlink-cli to CRE CLI + configur…
Browse files Browse the repository at this point in the history
…ation simplification
  • Loading branch information
Tofel committed Feb 3, 2025
1 parent 07167b8 commit d5f662d
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 94 deletions.
8 changes: 4 additions & 4 deletions integration-tests/smoke/capabilities/environment-ci.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
# without 0x prefix!
feed_id = "018bfe8840700040000000000000000000000000000000000000000000000000"

use_chainlink_cli = true
use_existing = true
use_cre_cli = true
should_compile_new_workflow = false

[workflow_config.dependencies]
capabilities_version = "v1.0.0-alpha"
chainlink_cli_version = "v1.0.2"
cre_cli_version = "v1.0.2"

[workflow_config.existing]
[workflow_config.compiled_config]
binary_url = "https://gist.githubusercontent.com/Tofel/8a39af5b68c213d2200446c175b5c99e/raw/cb7b2a56b37e333fe0bdce07b79538c4ce332f5f/binary.wasm.br"
config_url = "https://gist.githubusercontent.com/Tofel/19c80e6297914a79449f916e5e65dfdd/raw/1344c259ef7e970dbabaa1e9e885845b8eba5da9/config.json3674692696"

Expand Down
12 changes: 5 additions & 7 deletions integration-tests/smoke/capabilities/environment.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,18 @@
# without 0x prefix!
feed_id = "018bfe8840700040000000000000000000000000000000000000000000000000"

use_chainlink_cli = true
use_existing = false
use_cre_cli = true
should_compile_new_workflow = true
workflow_folder_location = "path-to-folder-with-main.go-of-your-workflow"

[workflow_config.dependencies]
capabilities_version = "v1.0.0-alpha"
chainlink_cli_version = "v1.0.2"
cre_cli_version = "v1.0.2"

[workflow_config.existing]
[workflow_config.compiled_config]
binary_url = "https://gist.githubusercontent.com/Tofel/8a39af5b68c213d2200446c175b5c99e/raw/cb7b2a56b37e333fe0bdce07b79538c4ce332f5f/binary.wasm.br"
config_url = "https://gist.githubusercontent.com/Tofel/19c80e6297914a79449f916e5e65dfdd/raw/1344c259ef7e970dbabaa1e9e885845b8eba5da9/config.json3674692696"

[workflow_config.chainlink_cli]
folder_location = "path-to-folder-with-main.go-of-your-workflow"

[nodeset]
nodes = 5
override_mode = "each"
Expand Down
28 changes: 12 additions & 16 deletions integration-tests/smoke/capabilities/guidelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ The test requires several environment variables. Below is a launch configuration
}
```

- **`GITHUB_READ_TOKEN`**: Required for downloading the `cron` capability binary and `chainlink-cli` (if enabled). Requires `content:read` permission for `smartcontractkit/capabilities` and `smartcontractkit/dev-platform` repositories. Use a fine-grained personal access token (PAT) tied to the **organization’s GitHub account**.
- **`GITHUB_READ_TOKEN`**: Required for downloading the `cron` capability binary and CRE CLI (if enabled). Requires `content:read` permission for `smartcontractkit/capabilities` and `smartcontractkit/dev-platform` repositories. Use a fine-grained personal access token (PAT) tied to the **organization’s GitHub account**.
- **`GIST_WRITE_TOKEN`**: Required only for compiling and uploading a new workflow. It needs `gist:read:write` permissions and should be a fine-grained PAT **tied to your personal GitHub account**.

Test also expects you to have the Job Distributor image available locally. By default, `environment.toml` expectes image tagged as `jd-test-1:latest`. The easiest way to get it, is to clone the Job Distributor repository and build it locally with:
Test also expects you to have the Job Distributor image available locally. By default, `environment.toml` expects image tagged as `jd-test-1:latest`. The easiest way to get it, is to clone the Job Distributor repository and build it locally with:
```bash
docker build -t jd-test-1 -f e2e/Dockerfile.e2e
```
Expand Down Expand Up @@ -130,16 +130,14 @@ For the test to compile and upload the binary, modify your TOML configuration:

```toml
[workflow_config]
use_chainlink_cli = true
use_existing = false

[workflow_config.chainlink_cli]
folder_location = "path-to-folder-with-main.go-of-your-workflow"
use_cre_cli = true
should_compile_new_workflow = true
workflow_folder_location = "path-to-folder-with-main.go-of-your-workflow"
```

### Workflow Configuration

If your workflow requires configuration, modify the test to create and pass the configuration data to `chainlink-cli`:
If your workflow requires configuration, modify the test to create and pass the configuration data to CRE CLI:

```go
configFile, err := os.CreateTemp("", "config.json")
Expand All @@ -163,10 +161,10 @@ If you compiled and uploaded the binary yourself, set the following in your conf

```toml
[workflow_config]
use_chainlink_cli = true
use_existing = true
use_cre_cli = true
should_compile_new_workflow = false

[workflow_config.existing]
[workflow_config.compiled_config]
binary_url = "<binary-url>"
config_url = "<config-url>"
```
Expand All @@ -183,11 +181,9 @@ If the deployer private key or deployment sequence changes, run the test in **up

```toml
[workflow_config]
use_chainlink_cli = true
use_existing = false

[workflow_config.chainlink_cli]
folder_location = "path-to-folder-with-main.go-of-your-workflow"
use_cre_cli = true
should_compile_new_workflow = true
workflow_folder_location = "path-to-folder-with-main.go-of-your-workflow"
```

---
Expand Down
Loading

0 comments on commit d5f662d

Please sign in to comment.