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(spell): bump spell to 0.5.17 and fix tests #1724

Merged
merged 6 commits into from
Jul 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 4 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ jobs:
ref: ${{ inputs.ref }}

- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1.5
uses: moonrepo/setup-rust@v0
with:
inherit-toolchain: true
cache-target: release

- name: Get PR labels
id: labels
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ jobs:
uses: actions/checkout@v3

- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1.5
uses: moonrepo/setup-rust@v0
with:
inherit-toolchain: true
cache-target: release

- name: Import secrets
uses: hashicorp/vault-action@v2.7.3
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ jobs:
token: ${{ secrets.FLUENCEBOT_RELEASE_PLEASE_PAT }}

- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
uses: moonrepo/setup-rust@v0
with:
inherit-toolchain: true
cache-target: debug

- name: Install cargo-edit
uses: baptiste0928/cargo-install@v2.1.0
Expand Down
5 changes: 4 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ jobs:
ref: ${{ inputs.ref }}

- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1
uses: moonrepo/setup-rust@v0
with:
inherit-toolchain: true
cache-target: debug

- name: Set dependencies
if: inputs.cargo-dependencies != 'null'
Expand Down
8 changes: 4 additions & 4 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ particle-execution = { path = "particle-execution" }
system-services = { path = "crates/system-services" }

# spell
fluence-spell-dtos = "=0.5.16"
fluence-spell-distro = "=0.5.16"
fluence-spell-dtos = "=0.5.17"
fluence-spell-distro = "=0.5.17"

# marine
fluence-app-service = {version = "=0.26.4-feat-wasm-backend-interface-update-b3cf050-636-1.0", registry = "fluence"}
Expand Down
27 changes: 21 additions & 6 deletions crates/nox-tests/tests/spells.rs
Original file line number Diff line number Diff line change
Expand Up @@ -901,10 +901,10 @@ async fn spell_timer_trigger_mailbox_test() {
(seq
(seq
(call %init_peer_id% ("getDataSrv" "spell_id") [] spell_id)
(call %init_peer_id% (spell_id "pop_mailbox") [] trigger)
(call %init_peer_id% (spell_id "pop_mailbox") [] result)
)
(seq
(call %init_peer_id% ("json" "parse") [trigger.$.str] obj)
(call %init_peer_id% ("json" "parse") [result.$.message.[0].message] obj)
(call "{}" ("return" "") [obj])
)
)
Expand Down Expand Up @@ -950,7 +950,7 @@ async fn spell_connection_pool_trigger_mailbox_test() {
)
)
(seq
(call %init_peer_id% ("json" "parse") [trigger.$.str] obj)
(call %init_peer_id% ("json" "parse") [trigger.$.message.[0].message] obj)
(call "{}" ("return" "") [obj])
)
)
Expand Down Expand Up @@ -1123,7 +1123,12 @@ async fn spell_update_config() {
.as_slice()
{
assert_eq!(x["absent"], JValue::Bool(false), "spell must be triggered");
let info: TriggerInfoAqua = serde_json::from_str(x["str"].as_str().unwrap()).unwrap();
let message = x["message"].as_array().unwrap()[0]
.as_object()
.cloned()
.unwrap();
let info: TriggerInfoAqua =
serde_json::from_str(message["message"].as_str().unwrap()).unwrap();
let info: TriggerInfo = info.into();
assert_matches!(info, TriggerInfo::Peer(p) if p.connected, "spell must be triggered by the `connected` event");
} else {
Expand Down Expand Up @@ -1174,7 +1179,12 @@ async fn spell_update_config() {
.as_slice()
{
assert_eq!(x["absent"], JValue::Bool(false), "spell must be triggered");
let info: TriggerInfoAqua = serde_json::from_str(x["str"].as_str().unwrap()).unwrap();
let message = x["message"].as_array().unwrap()[0]
.as_object()
.cloned()
.unwrap();
let info: TriggerInfoAqua =
serde_json::from_str(message["message"].as_str().unwrap()).unwrap();
let info: TriggerInfo = info.into();
assert_matches!(info, TriggerInfo::Peer(p) if !p.connected, "spell must be triggered by the `disconnected` event");
} else {
Expand Down Expand Up @@ -1246,7 +1256,12 @@ async fn spell_update_config_stopped_spell() {
.as_slice()
{
assert_eq!(x["absent"], JValue::Bool(false), "spell must be triggered");
let info: TriggerInfoAqua = serde_json::from_str(x["str"].as_str().unwrap()).unwrap();
let message = x["message"].as_array().unwrap()[0]
.as_object()
.cloned()
.unwrap();
let info: TriggerInfoAqua =
serde_json::from_str(message["message"].as_str().unwrap()).unwrap();
let info: TriggerInfo = info.into();
assert_matches!(
info,
Expand Down
Loading