Skip to content

Commit

Permalink
Switch the Sway sdk-harness tests to use Forc workspaces instead …
Browse files Browse the repository at this point in the history
…of the bash script `build.sh` (FuelLabs#4476)

## Description
Now that we have `Forc` workspaces, we can just have a workspace for all
the `sdk-harness` tests instead of having to compile the tests manually
using `build.sh`.

## Checklist

- [ ] I have linked to any relevant issues.
- [ ] I have commented my code, particularly in hard-to-understand
areas.
- [ ] I have updated the documentation where relevant (API docs, the
reference, and the Sway book).
- [ ] I have added tests that prove my fix is effective or that my
feature works.
- [ ] I have added (or requested a maintainer to add) the necessary
`Breaking*` or `New Feature` labels where relevant.
- [ ] I have done my best to ensure that my PR adheres to [the Fuel Labs
Code Review
Standards](https://github.com/FuelLabs/rfcs/blob/master/text/code-standards/external-contributors.md).
- [ ] I have requested a review from the relevant team or maintainers.

---------

Co-authored-by: bing <[email protected]>
  • Loading branch information
mohammadfawaz and eightfilms authored Apr 20, 2023
1 parent ebdbbfe commit 98f886b
Show file tree
Hide file tree
Showing 17 changed files with 414 additions and 95 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,7 @@ jobs:
toolchain: ${{ env.RUST_VERSION }}
- uses: Swatinem/rust-cache@v2
- name: Build All Tests
run: cd test/src/sdk-harness && bash build.sh --locked && cd ../../../
run: cargo run --locked -p forc -- build --locked --path ./test/src/sdk-harness
- name: Cargo Test sway-lib-std
run: cargo test --locked --manifest-path ./test/src/sdk-harness/Cargo.toml -- --nocapture

Expand Down
327 changes: 327 additions & 0 deletions test/src/sdk-harness/Forc.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,327 @@
[[package]]
name = 'auth_caller_contract'
source = 'member'
dependencies = [
'auth_testing_abi',
'std',
]

[[package]]
name = 'auth_caller_script'
source = 'member'
dependencies = [
'auth_testing_abi',
'std',
]

[[package]]
name = 'auth_testing_abi'
source = 'member'
dependencies = ['std']

[[package]]
name = 'auth_testing_contract'
source = 'member'
dependencies = [
'auth_testing_abi',
'std',
]

[[package]]
name = 'balance_contract'
source = 'member'
dependencies = ['std']

[[package]]
name = 'block'
source = 'member'
dependencies = [
'block_test_abi',
'std',
]

[[package]]
name = 'block_test_abi'
source = 'member'
dependencies = ['std']

[[package]]
name = 'call_frames'
source = 'member'
dependencies = [
'call_frames_test_abi',
'std',
]

[[package]]
name = 'call_frames_test_abi'
source = 'member'
dependencies = ['std']

[[package]]
name = 'configurables_in_contract'
source = 'member'
dependencies = ['std']

[[package]]
name = 'configurables_in_script'
source = 'member'
dependencies = ['std']

[[package]]
name = 'context'
source = 'member'
dependencies = [
'context_testing_abi',
'std',
]

[[package]]
name = 'context_caller_contract'
source = 'member'
dependencies = [
'context_testing_abi',
'std',
]

[[package]]
name = 'context_testing_abi'
source = 'member'
dependencies = ['std']

[[package]]
name = 'contract_bytecode'
source = 'member'
dependencies = ['std']

[[package]]
name = 'core'
source = 'path+from-root-5781B31F5E4458CC'

[[package]]
name = 'ec_recover'
source = 'member'
dependencies = ['std']

[[package]]
name = 'ec_recover_and_match_predicate'
source = 'member'
dependencies = ['std']

[[package]]
name = 'evm'
source = 'member'
dependencies = [
'evm_test_abi',
'std',
]

[[package]]
name = 'evm_ec_recover'
source = 'member'
dependencies = ['std']

[[package]]
name = 'evm_test_abi'
source = 'member'
dependencies = ['std']

[[package]]
name = 'generics_in_abi'
source = 'member'
dependencies = ['std']

[[package]]
name = 'hashing'
source = 'member'
dependencies = ['std']

[[package]]
name = 'logging'
source = 'member'
dependencies = ['std']

[[package]]
name = 'messages'
source = 'member'
dependencies = ['std']

[[package]]
name = 'methods_abi'
source = 'member'

[[package]]
name = 'methods_contract'
source = 'member'
dependencies = [
'methods_abi',
'std',
]

[[package]]
name = 'option_field_order'
source = 'member'
dependencies = ['std']

[[package]]
name = 'option_in_abi'
source = 'member'
dependencies = ['std']

[[package]]
name = 'parsing_logs'
source = 'member'
dependencies = [
'parsing_logs_test_abi',
'std',
]

[[package]]
name = 'parsing_logs_test_abi'
source = 'member'
dependencies = ['std']

[[package]]
name = 'pow'
source = 'member'
dependencies = ['std']

[[package]]
name = 'predicate_data_simple'
source = 'member'
dependencies = ['std']

[[package]]
name = 'predicate_data_struct'
source = 'member'
dependencies = ['std']

[[package]]
name = 'registers'
source = 'member'
dependencies = ['std']

[[package]]
name = 'result_in_abi'
source = 'member'
dependencies = ['std']

[[package]]
name = 'script_bytecode'
source = 'member'
dependencies = ['std']

[[package]]
name = 'script_data'
source = 'member'
dependencies = ['std']

[[package]]
name = 'std'
source = 'path+from-root-5781B31F5E4458CC'
dependencies = ['core']

[[package]]
name = 'storage'
source = 'member'
dependencies = ['std']

[[package]]
name = 'storage_bytes'
source = 'member'
dependencies = ['std']

[[package]]
name = 'storage_map'
source = 'member'
dependencies = ['std']

[[package]]
name = 'svec_array'
source = 'member'
dependencies = ['std']

[[package]]
name = 'svec_b256'
source = 'member'
dependencies = ['std']

[[package]]
name = 'svec_bool'
source = 'member'
dependencies = ['std']

[[package]]
name = 'svec_enum'
source = 'member'
dependencies = ['std']

[[package]]
name = 'svec_str'
source = 'member'
dependencies = ['std']

[[package]]
name = 'svec_struct'
source = 'member'
dependencies = ['std']

[[package]]
name = 'svec_tuple'
source = 'member'
dependencies = ['std']

[[package]]
name = 'svec_u16'
source = 'member'
dependencies = ['std']

[[package]]
name = 'svec_u32'
source = 'member'
dependencies = ['std']

[[package]]
name = 'svec_u64'
source = 'member'
dependencies = ['std']

[[package]]
name = 'svec_u8'
source = 'member'
dependencies = ['std']

[[package]]
name = 'test_contract'
source = 'member'
dependencies = ['std']

[[package]]
name = 'test_script'
source = 'member'
dependencies = ['std']

[[package]]
name = 'token_ops'
source = 'member'
dependencies = ['std']

[[package]]
name = 'tx_contract'
source = 'member'
dependencies = ['std']

[[package]]
name = 'tx_predicate'
source = 'member'
dependencies = ['std']

[[package]]
name = 'type_aliases'
source = 'member'
dependencies = ['std']

[[package]]
name = 'vec_in_abi'
source = 'member'
dependencies = ['std']
61 changes: 61 additions & 0 deletions test/src/sdk-harness/Forc.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
[workspace]
members = [
"test_projects/block",
"test_projects/call_frames",
"test_projects/configurables_in_contract",
"test_projects/configurables_in_script",
"test_projects/context",
"test_projects/contract_bytecode",
"test_projects/ec_recover",
"test_projects/ec_recover_and_match_predicate",
"test_projects/evm",
"test_projects/evm_ec_recover",
"test_projects/generics_in_abi",
"test_projects/hashing",
"test_projects/logging",
"test_projects/low_level_call",
"test_projects/messages",
"test_projects/option_field_order",
"test_projects/option_in_abi",
"test_projects/parsing_logs",
"test_projects/predicate_data_simple",
"test_projects/predicate_data_struct",
"test_projects/registers",
"test_projects/result_in_abi",
"test_projects/script_bytecode",
"test_projects/script_data",
"test_projects/storage",
"test_projects/storage_bytes",
"test_projects/storage_map",
"test_projects/token_ops",
"test_projects/tx_fields",
"test_projects/type_aliases",
"test_projects/vec_in_abi",
"test_artifacts/auth_caller_contract",
"test_artifacts/auth_caller_script",
"test_artifacts/auth_testing_abi",
"test_artifacts/auth_testing_contract",
"test_artifacts/balance_contract",
"test_artifacts/block_test_abi",
"test_artifacts/call_frames_test_abi",
"test_artifacts/context_caller_contract",
"test_artifacts/context_testing_abi",
"test_artifacts/evm_test_abi",
"test_artifacts/low_level_callee_contract",
"test_artifacts/methods_abi",
"test_artifacts/methods_contract",
"test_artifacts/parsing_logs_test_abi",
"test_artifacts/pow",
"test_artifacts/storage_vec/svec_array",
"test_artifacts/storage_vec/svec_bool",
"test_artifacts/storage_vec/svec_str",
"test_artifacts/storage_vec/svec_tuple",
"test_artifacts/storage_vec/svec_u32",
"test_artifacts/storage_vec/svec_u8",
"test_artifacts/storage_vec/svec_b256",
"test_artifacts/storage_vec/svec_enum",
"test_artifacts/storage_vec/svec_struct",
"test_artifacts/storage_vec/svec_u16",
"test_artifacts/storage_vec/svec_u64",
"test_artifacts/tx_contract",
]
Loading

0 comments on commit 98f886b

Please sign in to comment.