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

enterprise blobber allocation tests. #1094

Merged
merged 237 commits into from
Sep 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
237 commits
Select commit Hold shift + click to select a range
f2060d9
go mod tidy
Jayashsatolia403 Mar 10, 2024
da47b3c
Restricted blobber tests
Jayashsatolia403 Mar 20, 2024
a9422df
Changed repo snapshots
Jayashsatolia403 Mar 20, 2024
27ac46f
Merge branch 'master' into sprint-1.14
Jayashsatolia403 Mar 26, 2024
e0994b0
Merge branch 'refs/heads/master' into sprint-1.14
Jayashsatolia403 Apr 2, 2024
d21f717
Merge branch 'refs/heads/master' into sprint-1.14
Jayashsatolia403 Apr 2, 2024
803ba50
Skipped authorizer tests
Jayashsatolia403 Apr 2, 2024
49f095b
Merge branch 'refs/heads/master' into sprint-1.14
Jayashsatolia403 Apr 2, 2024
f1cbede
add owner api calls (#1047)
Sanchit011 Apr 7, 2024
444f542
Added feature blobber auth tests
Jayashsatolia403 Apr 8, 2024
6a6e660
Fix API tests create allocation
Jayashsatolia403 Apr 8, 2024
4a99711
Updated gosdk
Jayashsatolia403 Apr 8, 2024
37d9664
Merge branch 'refs/heads/sprint-1.14' into feature/blobber-auth
Jayashsatolia403 Apr 8, 2024
90f92ec
Updated gosdk
Jayashsatolia403 Apr 8, 2024
3990f94
Fix
Jayashsatolia403 Apr 8, 2024
32f1bc1
Fix
Jayashsatolia403 Apr 8, 2024
eff1e13
Fix blobber config update test =
Jayashsatolia403 Apr 8, 2024
48f7f65
Fix blobber config update cleanup
Jayashsatolia403 Apr 8, 2024
ff1b743
Fix
Jayashsatolia403 Apr 8, 2024
d5cb623
Hotfix/0box (#1049)
Sanchit011 Apr 9, 2024
b114d8e
Updated gosdk
Jayashsatolia403 Apr 11, 2024
c0218cd
fix commit err message (#1052)
Hitenjain14 Apr 11, 2024
274393e
Fix
Jayashsatolia403 Apr 14, 2024
5d494ef
Fix
Jayashsatolia403 Apr 14, 2024
f7d76d8
Fix
Jayashsatolia403 Apr 14, 2024
03b3e24
Fix
Jayashsatolia403 Apr 14, 2024
f557e07
Fix
Jayashsatolia403 Apr 14, 2024
5906a73
Fix
Jayashsatolia403 Apr 14, 2024
c4b29b2
Fix lint
Jayashsatolia403 Apr 14, 2024
67ae7ee
Fix
Jayashsatolia403 Apr 14, 2024
cd10097
Merge pull request #1031 from 0chain/feature/blobber-auth
dabasov Apr 14, 2024
619a423
tests to list stakable providers (#1036)
storybehind Apr 15, 2024
43f0884
Fix 0box tests with create allocation
Jayashsatolia403 Apr 15, 2024
069c96a
fix 0box tests
Sanchit011 Apr 15, 2024
9ba204a
Empty commit
Jayashsatolia403 Apr 16, 2024
1e20724
Fix restricted blobber tests
Jayashsatolia403 Apr 16, 2024
be7287d
Merge pull request #1054 from 0chain/fix/0box-tests
dabasov Apr 16, 2024
6a49c1d
Merge branch 'refs/heads/master' into sprint-1.14
Jayashsatolia403 Apr 22, 2024
11a6f88
Merge branch 'master' into sprint-1.14
Jayashsatolia403 Apr 22, 2024
a455567
Merge branch 'refs/heads/master' into sprint-1.14
Jayashsatolia403 Apr 22, 2024
ca51ad2
Update gosdk
Jayashsatolia403 Apr 23, 2024
b57c34f
Fix sharder config update
Jayashsatolia403 Apr 24, 2024
c826906
fix delete wallet (#1057)
Sanchit011 Apr 27, 2024
a64f648
Fixed file format and restricted blobbers test
Jayashsatolia403 Apr 28, 2024
055f288
Fix resume upload
Jayashsatolia403 Apr 28, 2024
6f8e983
Fix restricted blobbers
Jayashsatolia403 Apr 28, 2024
763c02c
fix resume download test (#1058)
Hitenjain14 Apr 28, 2024
22c07a9
Fix restricted blobbers
Jayashsatolia403 Apr 29, 2024
6581305
Fix restricted blobbers
Jayashsatolia403 Apr 29, 2024
df4597d
Fix restricted blobbers
Jayashsatolia403 Apr 29, 2024
15d8c16
added repair allocation with diff file size (#1034)
Zorro30 Apr 30, 2024
2772ccc
added test suite for dropbox
pewssh May 1, 2024
967e5cf
test suite for gdrive
pewssh May 1, 2024
3dba307
updated for workflow
pewssh May 2, 2024
a17b590
lint fix
pewssh May 2, 2024
acc5176
changes for dropbox tests
pewssh May 5, 2024
66cdcd6
Fix: Issue previous test cases
pewssh May 5, 2024
fe1aeb9
Added lib
pewssh Jun 13, 2024
3a32014
Resolve conflicts
pewssh Jun 13, 2024
4a7553e
disable lint
pewssh Jun 13, 2024
27cea92
Test for mc and zs3server
pewssh Jun 21, 2024
f5aa94d
* Test cases for mc commands and warp benchmarking tool
pewssh Jul 4, 2024
b7df8ac
Test Cases Formatted
pewssh Jul 4, 2024
5d2a5b7
updated comment
pewssh Jul 4, 2024
539c50a
Added changes
pewssh Jul 12, 2024
bf4c2d9
pulled changes from 1.17
pewssh Jul 12, 2024
50ed4a5
updated readme
pewssh Jul 12, 2024
e9e6710
Added binary for mc
pewssh Jul 13, 2024
7e6e507
re
pewssh Jul 13, 2024
288ff1f
updated for mc
pewssh Jul 13, 2024
08c66be
Warp
pewssh Jul 14, 2024
061cac1
Added minio
pewssh Jul 14, 2024
479041a
Updated for mc_wrap_test_cases
pewssh Jul 14, 2024
d74313b
updated dir config
pewssh Jul 15, 2024
3285503
lint fix
pewssh Jul 15, 2024
93bf3e7
updated cli
pewssh Jul 15, 2024
1527ce8
Fix failing testcases for PR #1043 (#1077)
yash10019coder Jul 15, 2024
d780dca
main_test.go
pewssh Jul 15, 2024
280bfcc
Reset location for cli
pewssh Jul 16, 2024
437a1a4
Common server
pewssh Jul 16, 2024
0d5d9c2
Merge pull request #1088 from 0chain/mc_warp_test_cases
pewssh Jul 16, 2024
d00d61f
Revert "Mc warp test cases"
pewssh Jul 16, 2024
60b89f5
Merge pull request #1089 from 0chain/revert-1088-mc_warp_test_cases
pewssh Jul 16, 2024
80d9090
Merge branch 'master' into sprint-1.17
Jayashsatolia403 Jul 17, 2024
9420e34
Merge branch 'master' into sprint-1.17
Jayashsatolia403 Jul 17, 2024
6860030
enterprise create allocation test.
yash10019coder Jul 23, 2024
3516323
running rollback allocation tests parallel. (#1096)
yash10019coder Jul 25, 2024
c375620
create tests for cancel and update allocation for enterprise blobbers.
yash10019coder Jul 26, 2024
8c70001
move create allocation enterprise from cli_tests to tokenometrics_tes…
yash10019coder Jul 26, 2024
3fc7bab
fixes for package migration for create allocation tests.
yash10019coder Jul 26, 2024
8557758
file rename.
yash10019coder Jul 26, 2024
79ecda2
fix package migration errors for update and cancel allocation.
yash10019coder Jul 26, 2024
3753351
nit fixes.
yash10019coder Jul 26, 2024
05af77f
nit fixes.
yash10019coder Jul 29, 2024
18dde3e
expose setupAllocation in allocation.go
yash10019coder Jul 29, 2024
9d46306
add enterprise allocation flags.
yash10019coder Jul 29, 2024
660b0a6
Deploy enterprise blobbers
Jayashsatolia403 Jul 29, 2024
3eb4df3
add new method for create enterprise allocation in allocation.go
yash10019coder Jul 30, 2024
1fcaf83
add test setup for listing blobbers in create allocation.
yash10019coder Jul 30, 2024
1e999e2
created a specialized utility method for directly getting all the blo…
yash10019coder Jul 30, 2024
512e726
auth ticket fixes for enterprise create allocation tests
yash10019coder Jul 31, 2024
870bb1c
temp commit.
yash10019coder Jul 31, 2024
0975cbb
Review
Jayashsatolia403 Jul 31, 2024
6fefd4b
added utility methods for setting enterprise allocation with wallet.
yash10019coder Aug 1, 2024
3e9de42
add new method for getting wallet by name in econometrics utils.
yash10019coder Aug 2, 2024
3b3ab0a
add test case for enterprise allocation fail without auth tickets.
yash10019coder Aug 2, 2024
9602f87
add new cost check related cases for cancel allocation.
yash10019coder Aug 6, 2024
2db3ca6
cancel allocation cost calculation updates.
yash10019coder Aug 9, 2024
fd3af7b
fix update allocation tests.
yash10019coder Aug 9, 2024
c7a00c0
fix: cancel allocation first two tests.
yash10019coder Aug 9, 2024
82d8823
refactor: cancel allocation tests.
yash10019coder Aug 10, 2024
0e42e61
refactor: cancel allocation tests.
yash10019coder Aug 10, 2024
0895f2f
uncomment time.Sleep from test cases in cancel allocation.
yash10019coder Aug 10, 2024
ccdcfc9
refactor: cancel allocaiton tests.
yash10019coder Aug 10, 2024
5b55b4c
refactor: update allocation tests move failing tests at the bottom.
yash10019coder Aug 10, 2024
ac0c5ac
refactor: add test setup for time change unit.
yash10019coder Aug 10, 2024
dd5f486
refactor: replace blobber tests.
yash10019coder Aug 10, 2024
ef6b6f3
update blobber updates.
yash10019coder Aug 11, 2024
4c1ef8c
cost calculations for update allocation tests.
yash10019coder Aug 12, 2024
5c072ab
fix syntax error in update blobber test.
yash10019coder Aug 12, 2024
d262d9f
Added basic cost related tests
Jayashsatolia403 Aug 12, 2024
3b26b72
Merge remote-tracking branch 'origin/feat/enterprise-blobber-tests' i…
Jayashsatolia403 Aug 12, 2024
2d3033d
Remove skip
Jayashsatolia403 Aug 12, 2024
12f95f2
create new utility method for getting blobber details.
yash10019coder Aug 12, 2024
b310ae5
Added rewards check
Jayashsatolia403 Aug 12, 2024
3c7e16f
Merge remote-tracking branch 'origin/feat/enterprise-blobber-tests' i…
Jayashsatolia403 Aug 12, 2024
fb38e2c
Fix duration replace blobber
Jayashsatolia403 Aug 12, 2024
7d5b062
Debug
Jayashsatolia403 Aug 13, 2024
3af3461
Fix
Jayashsatolia403 Aug 13, 2024
2cbd9ad
Fix
Jayashsatolia403 Aug 13, 2024
3025c6d
replace blobber add cleanup method to restore blobber write prices.
yash10019coder Aug 13, 2024
0c1bc23
move failing test cases to bottom in create allocation tests.
yash10019coder Aug 13, 2024
d0b703a
fix: wallet creation error for finalize allocation.
yash10019coder Aug 14, 2024
07c9953
refactor: add cli config path field to blobber auth ticket utilty met…
yash10019coder Aug 14, 2024
aa9754e
feat: add cost calculations to all tests in cancel allocation.
yash10019coder Aug 15, 2024
033c311
feat: add cost calculation check for finalize allocation.
yash10019coder Aug 15, 2024
03d68d6
Merge branch 'sprint-1.17' of github.com:0chain/system_test into feat…
yash10019coder Aug 15, 2024
abecd93
removed wait time for cancel allocation test cases where we are updat…
yash10019coder Aug 16, 2024
9c4a4d7
debug finalize allocation.
yash10019coder Aug 16, 2024
b570ad3
refactor: finalize allocation after duration test case.
yash10019coder Aug 16, 2024
0dc2299
price change tests.
yash10019coder Aug 16, 2024
2f5dad7
yash10019coder Aug 16, 2024
2c082d5
change lock price in finalize allocation tests to be exact 2e9.
yash10019coder Aug 18, 2024
27f3962
fix allocation writee pool and blobber reward calculations.
yash10019coder Aug 18, 2024
4a5fa8b
add bloober rewards calculations from stake pool in update allocation…
yash10019coder Aug 18, 2024
99af4a7
refactor: fix cost allocation calculations, change data and parity sh…
yash10019coder Aug 19, 2024
9140b8e
refactor: update allocation add cleanup methods.
yash10019coder Aug 19, 2024
d317d69
refactor: move blobber price change tests to bottom to run sequentially.
yash10019coder Aug 19, 2024
f81176f
refactor: add compare allocation to update allocation price tests.
yash10019coder Aug 19, 2024
6ac8e55
nit fix cost calculation blobber price change update allocaiton test.
yash10019coder Aug 19, 2024
c7bf80a
refactor: update allocation blobber price change extend unused alloca…
yash10019coder Aug 19, 2024
f976794
remove cleanup update allocation for non existing allocation test.
yash10019coder Aug 19, 2024
aa1def6
refactor: matching expected write pool tokens in epsilon after updati…
yash10019coder Aug 20, 2024
ff2f9db
refactor: fix blobber reward cost calculations in update allocation.
yash10019coder Aug 21, 2024
1778688
refactor: fix blobber reward cost calculations in update allocation.
yash10019coder Aug 21, 2024
db2e041
refactor: finalize allocation test case for updating allocation.
yash10019coder Aug 22, 2024
98c270e
refactor: update allocation blobber price test for upgrading size.
yash10019coder Aug 22, 2024
be1208c
refactor: update allocation blobber price test for extending duration.
yash10019coder Aug 22, 2024
c2f892a
refactor: add logs to update allocation blobber price test extend dur…
yash10019coder Aug 22, 2024
d1082fb
nit fix update allocation tests.
yash10019coder Aug 22, 2024
598f2b1
nit fix update allocation tests for blobber price chagne
yash10019coder Aug 22, 2024
5263c6e
using 4 min waits instead of 5 and also using exact values for lockin…
yash10019coder Aug 22, 2024
631d22a
refactor: update blobber price test.
yash10019coder Aug 23, 2024
69154ed
refactor: update blobber price test.
yash10019coder Aug 23, 2024
d77a572
nit cost fixes update allocation blobber price tests.
yash10019coder Aug 24, 2024
8d77775
nit fix.
yash10019coder Aug 24, 2024
5c7c288
adding time consumed after first update for update allocation blobber…
yash10019coder Aug 24, 2024
0cfc486
debug: green run update allocation blobber price change tests.
yash10019coder Aug 25, 2024
26a8005
debug: tests are not passing for first update expected rewards blobbe…
yash10019coder Aug 25, 2024
8e79e35
refactor: replace blobber tests include cost calculations.
yash10019coder Aug 25, 2024
fb506c9
Fix system tests
Jayashsatolia403 Aug 25, 2024
3db0333
Revert "Fix system tests"
Jayashsatolia403 Aug 25, 2024
057c2c6
refactor: setup allocation method for replace blobber.
yash10019coder Aug 26, 2024
27ba3d9
refactor: update allocation extend duration cost calculation test.
yash10019coder Aug 27, 2024
8cc93fa
refactor: replace blobber tests.
yash10019coder Aug 27, 2024
3736b7a
debug replace blobber 0.5x price.
yash10019coder Aug 29, 2024
87d355d
remove duplicate test.
yash10019coder Aug 29, 2024
55ccc98
refactor: replace blobber allocation tests
yash10019coder Aug 29, 2024
7d6a127
refactor: change deploy action to master branch in ci/cd
yash10019coder Aug 29, 2024
fdb9c33
refactor: replace blobber tests green run.
yash10019coder Aug 30, 2024
50a8564
refactor: test setup method for update and replace allocation tests.
yash10019coder Aug 30, 2024
408494e
fix: green run for finalize allocation.
yash10019coder Aug 30, 2024
630ae67
lint fixes.
yash10019coder Aug 30, 2024
938ea3d
lint fixes.
yash10019coder Aug 30, 2024
6589582
use new enterprise blobber 0chain deployment action.
yash10019coder Aug 31, 2024
6aef3e1
refactor: chnage name for enterprise blobber replace allocation tests.
yash10019coder Aug 31, 2024
5e00475
feat: add enterprise blobber tests in tokenomics nightly run.
yash10019coder Aug 31, 2024
0d03f6d
refactor: tokenomics_ci move enterprise blobber tests to top.
yash10019coder Aug 31, 2024
13e4b11
refactor: tokenomics_ci.yml fix network deployment.
yash10019coder Aug 31, 2024
b198558
refactor: tokenomics_ci.yml fix network deployment.
yash10019coder Aug 31, 2024
d789d52
refactor: tokenomics_ci.yml fix test run branch.
yash10019coder Aug 31, 2024
533c6a8
fix: actions test run branch.
yash10019coder Aug 31, 2024
9bbacf4
debug: disable notifications for slack on tokenomics workflow run
yash10019coder Aug 31, 2024
3630918
debug: pass enterprise blobber tests branch.
yash10019coder Aug 31, 2024
ea1a7fb
debug: set n/w to static.
yash10019coder Aug 31, 2024
e5b1aaa
Revert "debug: set n/w to static."
yash10019coder Aug 31, 2024
80c22ac
debug: blobber list method.
yash10019coder Aug 31, 2024
bf32ac0
Revert "debug: blobber list method."
yash10019coder Aug 31, 2024
031066c
debug: network deployment tokenomics ci.
yash10019coder Aug 31, 2024
a7b6feb
nit fixes.
yash10019coder Sep 1, 2024
ac65d83
debug tokenomics_ci.yml
yash10019coder Sep 1, 2024
4103c67
Merge branch 'sprint-1.17' of github.com:0chain/system_test into feat…
yash10019coder Sep 1, 2024
78e9b89
upgrade gosdk to latest sprint-1.17
yash10019coder Sep 1, 2024
577283d
debug change deployment action.
yash10019coder Sep 1, 2024
c810d1c
update gosdk to latest.
yash10019coder Sep 1, 2024
e15c560
green run fixes for create allocation tests.
yash10019coder Sep 1, 2024
45c26b7
reduced facuet tokens in create allocation tests.
yash10019coder Sep 1, 2024
9d306c8
fix kubeconfig param passing tokenomics_ci.yml
yash10019coder Sep 2, 2024
3775674
refactor: update error message.
yash10019coder Sep 2, 2024
a0e6c6c
refactor: add blobber reset prices at test startup.
yash10019coder Sep 2, 2024
8c18b5b
refactor: run update allocation run tests in parallel for non price c…
yash10019coder Sep 2, 2024
34f64ae
deploying clean n/w for every enterprise blobber test suite.
yash10019coder Sep 2, 2024
c66b201
refactor: green run cancel allocation.
yash10019coder Sep 2, 2024
3a2f282
nit fixes.
yash10019coder Sep 2, 2024
8bf65a7
Revert "deploying clean n/w for every enterprise blobber test suite."
yash10019coder Sep 3, 2024
e512630
refactor: moving enterprise blobber tests at bottom to monitor other …
yash10019coder Sep 3, 2024
e34e6ad
fix: add tenderly account testnet creation and deletion steps.
yash10019coder Sep 3, 2024
8729719
update gosdk with latest fix.
yash10019coder Sep 3, 2024
d4c2560
revert command error outputs for enterprise blobbers tokenomics tests.
yash10019coder Sep 5, 2024
66056e9
go mod tidy.
yash10019coder Sep 5, 2024
4640200
upgrade gosdk to v1.17.3
yash10019coder Sep 5, 2024
7c35edc
refactor: error message for create enterprise allocation test.
yash10019coder Sep 5, 2024
689e922
cleanup test setups.
yash10019coder Sep 5, 2024
ccdedc3
more cleanup.
yash10019coder Sep 5, 2024
b46829d
refactor: revert test output enterprise create allocation.
yash10019coder Sep 5, 2024
035533e
refactor: move blobber price change tests to top to run them sequenti…
yash10019coder Sep 5, 2024
a315a7d
Merge branch 'master' into feat/enterprise-blobber-tests
yash10019coder Sep 6, 2024
9045398
enable slack notifications for tokenomics_ci.yml
yash10019coder Sep 5, 2024
0607913
add nolint on error message mispells from 0chain.
yash10019coder Sep 6, 2024
aeef7d9
revert api model to remove Enterprise param.
yash10019coder Sep 6, 2024
dc55435
revert ci-dev-st.yml deploy 0chain to master branch.
yash10019coder Sep 6, 2024
a6211da
more cleanup.
yash10019coder Sep 6, 2024
9d2a393
reset configs to orignal dev n/w.
yash10019coder Sep 6, 2024
fe4b753
lint formatting for repair_allocation_test.go
yash10019coder Sep 6, 2024
2a1a542
remove review comments.
yash10019coder Sep 6, 2024
a490129
run goimports to fix lint.
yash10019coder Sep 6, 2024
07ebee3
update gosdk to v1.17.5
yash10019coder Sep 7, 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
152 changes: 148 additions & 4 deletions .github/workflows/tokenomics_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,25 @@ jobs:
with:
github-token: ${{ github.token }}

- name: 'Setup jq'
uses: dcarbone/[email protected]
with:
version: '1.7'
force: 'false'

- name: "Create Tenderly virtual testnet"
run: |
echo "TENDERLY_CREATION_INFO=$(curl -X POST \
-H "x-access-key: ${{ secrets.TENDERLY_SECRET }}" \
-H "Content-Type: application/json" \
-d '{"slug":"mainnet-dev-${{ env.RUNNER_NUMBER }}-${{ github.run_id }}","displayName":"mainnet-dev-${{ env.RUNNER_NUMBER }}-${{ github.run_id }}","description":"","visibility":"TEAM","tags":{"purpose":"development"},"networkConfig":{"networkId":"1","blockNumber":"18512782","chainConfig":{"chainId":"1"},"baseFeePerGas":"1"},"explorerConfig":{"enabled":false,"verificationVisibility":"bytecode"},"syncState":false}' \
https://api.tenderly.co/api/v1/account/zus_network/project/project/testnet/container)" >> $GITHUB_ENV

- name: "Parse Tenderly virtual testnet creation transaction result"
run: |
echo "TENDERLY_VIRTUAL_TESTNET_ID=$(echo '${{ env.TENDERLY_CREATION_INFO }}' | jq -r '.container.id')" >> $GITHUB_ENV
echo "TENDERLY_VIRTUAL_TESTNET_RPC_ID=$(echo '${{ env.TENDERLY_CREATION_INFO }}' | jq -r '.container.connectivityConfig.endpoints[0].id')" >> $GITHUB_ENV

- name: "Config: Run tests against existing 0Chain network"
if: github.event_name == 'workflow_dispatch' && github.event.inputs.existing_network != ''
run: |
Expand All @@ -44,9 +63,134 @@ jobs:
echo "TOKENOMICS_SLASH_REWARD_TESTS=$(echo $(([ -z 'TestBlobberSlashPenalty' ] && echo '') || echo 'TestBlobberSlashPenalty'))" >> $GITHUB_ENV
echo "TOKENOMICS_BLOCK_REWARD_TESTS=$(echo $(([ -z 'TestBlockRewardsForBlobbers' ] && echo '') || echo 'TestBlockRewardsForBlobbers'))" >> $GITHUB_ENV
echo "TOKENOMICS_MIN_STAKE_TESTS=$(echo $(([ -z 'TestMinStakeForProviders' ] && echo '') || echo 'TestMinStakeForProviders'))" >> $GITHUB_ENV
echo "ENTERPRISE_BLOBBER_CREATE_ALLOCATION_TESTS=$(echo $(([ -z 'TestCreateEnterpriseAllocation' ] && echo '') || echo 'TestCreateEnterpriseAllocation'))" >> $GITHUB_ENV
echo "ENTERPRISE_BLOBBER_UPDATE_ALLOCATION_TESTS=$(echo $(([ -z 'TestUpdateEnterpriseAllocation' ] && echo '') || echo 'TestUpdateEnterpriseAllocation'))" >> $GITHUB_ENV
echo "ENTERPRISE_BLOBBER_REPLACE_ALLOCATION_TESTS=$(echo $(([ -z 'TestReplaceEnterpriseBlobberAllocation' ] && echo '') || echo 'TestReplaceEnterpriseBlobberAllocation'))" >> $GITHUB_ENV
echo "ENTERPRISE_BLOBBER_CANCEL_ALLOCATION_TESTS=$(echo $(([ -z 'TestCancelEnterpriseAllocation' ] && echo '') || echo 'TestCancelEnterpriseAllocation'))" >> $GITHUB_ENV
echo "ENTERPRISE_BLOBBER_FINALIZE_ALLOCATION_TESTS=$(echo $(([ -z 'TestFinalizeEnterpriseAllocation' ] && echo '') || echo 'TestFinalizeEnterpriseAllocation'))" >> $GITHUB_ENV
echo "CLIENT_THROTTLING=$(echo $(([ -z 'TestClientThrottling' ] && echo '') || echo 'TestClientThrottling'))" >> $GITHUB_ENV
echo "REPO_SNAPSHOTS_BRANCH=current-sprint" >> $GITHUB_ENV

- name: "Deploy 0Chain with enterprise blobbers"
if: github.event_name == 'push' || github.event.inputs.existing_network == ''
uses: 0chain/actions/deploy-0chain@feature/enterprise-blobber
with:
repo_snapshots_branch: "${{ env.REPO_SNAPSHOTS_BRANCH }}"
kube_config: ${{ secrets[format('DEV{0}KC', env.RUNNER_NUMBER)] }}
teardown_condition: "TESTS_PASSED"
SUBGRAPH_API_URL: ${{ secrets.SUBGRAPH_API_URL }}
TENDERLY_VIRTUAL_TESTNET_RPC_ID: ${{ env.TENDERLY_VIRTUAL_TESTNET_RPC_ID }}
graphnode_sc: ${{ secrets.GRAPHNODE_SC }}
graphnode_network: ${{ secrets.GRAPHNODE_NETWORK }}
graphnode_ethereum_node_url: https://virtual.mainnet.rpc.tenderly.co/${{ env.TENDERLY_VIRTUAL_TESTNET_RPC_ID }}
svc_account_secret: ${{ secrets.SVC_ACCOUNT_SECRET }}

- name: "Run Enterprise blobber create allocation tests"
uses: 0chain/actions/run-system-tests-tokenomics@master
with:
repo_snapshots_branch: "${{ env.REPO_SNAPSHOTS_BRANCH }}"
network: ${{ env.NETWORK_URL }}
svc_account_secret: ${{ secrets.SVC_ACCOUNT_SECRET }}
deploy_report_page: true
system_tests_branch: feat/enterprise-blobber-tests
archive_results: true
run_flaky_tests: false
run_api_system_tests: false
run_cli_system_tests: false
run_tokenomics_system_tests: true
tokenomics_test_filter: ${{ env.ENTERPRISE_BLOBBER_CREATE_ALLOCATION_TESTS }}
run_smoke_tests: ${{ inputs.run_smoke_tests }}
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }}
TENDERLY_VIRTUAL_TESTNET_RPC_ID: ${{ env.TENDERLY_VIRTUAL_TESTNET_RPC_ID }}

- name: "Run Enterprise blobber update allocation tests"
uses: 0chain/actions/run-system-tests-tokenomics@master
with:
repo_snapshots_branch: "${{ env.REPO_SNAPSHOTS_BRANCH }}"
network: ${{ env.NETWORK_URL }}
svc_account_secret: ${{ secrets.SVC_ACCOUNT_SECRET }}
deploy_report_page: true
archive_results: true
run_flaky_tests: false
system_tests_branch: feat/enterprise-blobber-tests
run_api_system_tests: false
run_cli_system_tests: false
run_tokenomics_system_tests: true
tokenomics_test_filter: ${{ env.ENTERPRISE_BLOBBER_UPDATE_ALLOCATION_TESTS }}
TENDERLY_VIRTUAL_TESTNET_ID: ""
run_smoke_tests: ${{ inputs.run_smoke_tests }}
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }}
TENDERLY_VIRTUAL_TESTNET_RPC_ID: ${{ env.TENDERLY_VIRTUAL_TESTNET_RPC_ID }}

- name: "Run Enterprise blobber replace blobber allocation tests"
uses: 0chain/actions/run-system-tests-tokenomics@master
with:
repo_snapshots_branch: "${{ env.REPO_SNAPSHOTS_BRANCH }}"
network: ${{ env.NETWORK_URL }}
svc_account_secret: ${{ secrets.SVC_ACCOUNT_SECRET }}
deploy_report_page: true
archive_results: true
system_tests_branch: feat/enterprise-blobber-tests
run_flaky_tests: false
run_api_system_tests: false
run_cli_system_tests: false
run_tokenomics_system_tests: true
tokenomics_test_filter: ${{ env.ENTERPRISE_BLOBBER_REPLACE_ALLOCATION_TESTS }}
TENDERLY_VIRTUAL_TESTNET_ID: ""
run_smoke_tests: ${{ inputs.run_smoke_tests }}
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }}
TENDERLY_VIRTUAL_TESTNET_RPC_ID: ${{ env.TENDERLY_VIRTUAL_TESTNET_RPC_ID }}

- name: "Run Enterprise blobber cancel allocation tests"
uses: 0chain/actions/run-system-tests-tokenomics@master
with:
repo_snapshots_branch: "${{ env.REPO_SNAPSHOTS_BRANCH }}"
network: ${{ env.NETWORK_URL }}
svc_account_secret: ${{ secrets.SVC_ACCOUNT_SECRET }}
deploy_report_page: true
archive_results: true
run_flaky_tests: false
system_tests_branch: feat/enterprise-blobber-tests
run_api_system_tests: false
run_cli_system_tests: false
run_tokenomics_system_tests: true
tokenomics_test_filter: ${{ env.ENTERPRISE_BLOBBER_CANCEL_ALLOCATION_TESTS }}
TENDERLY_VIRTUAL_TESTNET_ID: ""
run_smoke_tests: ${{ inputs.run_smoke_tests }}
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }}
TENDERLY_VIRTUAL_TESTNET_RPC_ID: ${{ env.TENDERLY_VIRTUAL_TESTNET_RPC_ID }}

- name: "Run Enterprise blobber finalize allocation tests"
uses: 0chain/actions/run-system-tests-tokenomics@master
with:
repo_snapshots_branch: "${{ env.REPO_SNAPSHOTS_BRANCH }}"
network: ${{ env.NETWORK_URL }}
svc_account_secret: ${{ secrets.SVC_ACCOUNT_SECRET }}
deploy_report_page: true
system_tests_branch: feat/enterprise-blobber-tests
archive_results: true
run_flaky_tests: false
run_api_system_tests: false
run_cli_system_tests: false
run_tokenomics_system_tests: true
tokenomics_test_filter: ${{ env.ENTERPRISE_BLOBBER_FINALIZE_ALLOCATION_TESTS }}
TENDERLY_VIRTUAL_TESTNET_ID: ""
run_smoke_tests: ${{ inputs.run_smoke_tests }}
S3_ACCESS_KEY: ${{ secrets.S3_ACCESS_KEY }}
S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }}
TENDERLY_VIRTUAL_TESTNET_RPC_ID: ${{ env.TENDERLY_VIRTUAL_TESTNET_RPC_ID }}

- name: "Remove Tenderly virtual testnet"
if: always()
run: |
curl -X DELETE \
-H "x-access-key: ${{ secrets.TENDERLY_SECRET }}" \
-H "Content-Type: application/json" \
https://api.tenderly.co/api/v1/account/zus_network/project/project/testnet/container/${{ env.TENDERLY_VIRTUAL_TESTNET_ID }}

- name: "Deploy 0Chain"
if: github.event_name == 'push' || github.event.inputs.existing_network == ''
Expand Down Expand Up @@ -261,8 +405,8 @@ jobs:


notify_slack_on_failure:
runs-on: [self-hosted, arc-runner]
needs: [system-tests]
runs-on: [ self-hosted, arc-runner ]
needs: [ system-tests ]
if: always() && (needs.system-tests.result == 'failure')
steps:
- name: "Notify Slack"
Expand All @@ -279,8 +423,8 @@ jobs:
curl -X POST -H 'Content-type: application/json' --data "${payload}" ${{ secrets.DEVOPS_CHANNEL_WEBHOOK_URL }}

notify_slack_on_success:
runs-on: [self-hosted, arc-runner]
needs: [system-tests]
runs-on: [ self-hosted, arc-runner ]
needs: [ system-tests ]
if: always() && (needs.system-tests.result == 'success')
steps:
- name: "Notify Slack"
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ toolchain go1.22.1

require (
github.com/0chain/errors v1.0.3
github.com/0chain/gosdk v1.17.3
github.com/0chain/gosdk v1.17.5
github.com/go-resty/resty/v2 v2.7.0
github.com/herumi/bls-go-binary v1.31.0
github.com/shopspring/decimal v1.3.1
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ github.com/0chain/common v0.0.6-0.20230127095721-8df4d1d72565 h1:z+DtCR8mBsjPnEs
github.com/0chain/common v0.0.6-0.20230127095721-8df4d1d72565/go.mod h1:UyDC8Qyl5z9lGkCnf9RHJPMektnFX8XtCJZHXCCVj8E=
github.com/0chain/errors v1.0.3 h1:QQZPFxTfnMcRdt32DXbzRQIfGWmBsKoEdszKQDb0rRM=
github.com/0chain/errors v1.0.3/go.mod h1:xymD6nVgrbgttWwkpSCfLLEJbFO6iHGQwk/yeSuYkIc=
github.com/0chain/gosdk v1.17.3 h1:nL6x1saSwTku1UFDYoX/uKJO57VQTgowp6id+7UHb7g=
github.com/0chain/gosdk v1.17.3/go.mod h1:y7Ucdmv40VltqulZnncMNjNQ4piX5Dta5ujNmPmXnxg=
github.com/0chain/gosdk v1.17.5 h1:WusXPOj+lyK9XBUY1JPjBqPmkGV4A0J6bqsRluseusg=
github.com/0chain/gosdk v1.17.5/go.mod h1:y7Ucdmv40VltqulZnncMNjNQ4piX5Dta5ujNmPmXnxg=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/Luzifer/go-openssl/v3 v3.1.0 h1:QqKqo6kYXGGUsvtUoCpRZm8lHw+jDfhbzr36gVj+/gw=
Expand Down
44 changes: 22 additions & 22 deletions tests/api_tests/repair_allocation_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,18 +353,18 @@ func TestRepairSize(testSetup *testing.T) {
wallet := createWallet(t)
sdkClient.SetWallet(t, wallet)
apiClient.CreateReadPool(t, wallet, 0.5, client.TxSuccessfulStatus)
t.RunSequentiallyWithTimeout("repair size in case of no blobber failure should be zero", 5 * time.Minute, func(t *test.SystemTest) {

t.RunSequentiallyWithTimeout("repair size in case of no blobber failure should be zero", 5*time.Minute, func(t *test.SystemTest) {
// create allocation with default blobber requirements
blobberRequirements := model.DefaultBlobberRequirements(wallet.Id, wallet.PublicKey)
allocationBlobbers := apiClient.GetAllocationBlobbers(t, wallet, &blobberRequirements, client.HttpOkStatus)
allocationID := apiClient.CreateAllocation(t, wallet, allocationBlobbers, client.TxSuccessfulStatus)
t.Logf("allocationID: %v", allocationID)

// create and upload a file of 2KB to allocation.
op := sdkClient.AddUploadOperation(t, "", "", int64(1024 * 2))
op := sdkClient.AddUploadOperation(t, "", "", int64(1024*2))
sdkClient.MultiOperation(t, allocationID, []sdk.OperationRequest{op})

// assert both upload and download size should be zero
alloc, err := sdk.GetAllocation(allocationID)
require.NoErrorf(t, err, "allocation ID %v is not found", allocationID)
Expand All @@ -374,8 +374,8 @@ func TestRepairSize(testSetup *testing.T) {
require.Equal(t, uint64(0), rs.UploadSize, "upload size doesn't match")
require.Equal(t, uint64(0), rs.DownloadSize, "download size doesn't match")
})
t.RunSequentiallyWithTimeout("repair size on single blobber failure should match", 5 * time.Minute, func(t *test.SystemTest) {

t.RunSequentiallyWithTimeout("repair size on single blobber failure should match", 5*time.Minute, func(t *test.SystemTest) {
// create allocation with default blobber requirements
blobberRequirements := model.DefaultBlobberRequirements(wallet.Id, wallet.PublicKey)
blobberRequirements.DataShards = 2
Expand All @@ -390,18 +390,18 @@ func TestRepairSize(testSetup *testing.T) {
alloc, err := sdk.GetAllocation(allocationID)
require.NoErrorf(t, err, "allocation ID %v is not found", allocationID)
alloc.Blobbers[0].Baseurl = "http://0zus.com/"
op := sdkClient.AddUploadOperation(t, "", "", int64(1024 * 2))
op := sdkClient.AddUploadOperation(t, "", "", int64(1024*2))
sdkClient.MultiOperation(t, allocationID, []sdk.OperationRequest{op}, client.WithRepair(alloc.Blobbers))

// assert upload and download size should be 1KB and 2KB respectively
rs, err := alloc.RepairSize("/")
require.Nil(t, err)
t.Logf("repair size: %v", rs)
require.Equal(t, uint64(1024), rs.UploadSize, "upload size doesn't match")
require.Equal(t, uint64(1024 * 2), rs.DownloadSize, "download size doesn't match")
require.Equal(t, uint64(1024*2), rs.DownloadSize, "download size doesn't match")
})

t.RunSequentiallyWithTimeout("repair size with nested directories and two blobber failure should match", 5 * time.Minute, func(t *test.SystemTest) {
t.RunSequentiallyWithTimeout("repair size with nested directories and two blobber failure should match", 5*time.Minute, func(t *test.SystemTest) {
// create allocation with default blobber requirements
blobberRequirements := model.DefaultBlobberRequirements(wallet.Id, wallet.PublicKey)
blobberRequirements.DataShards = 2
Expand All @@ -419,31 +419,31 @@ func TestRepairSize(testSetup *testing.T) {
ops := []sdk.OperationRequest{
sdkClient.AddUploadOperationWithPath(t, allocationID, "/dir1/"),
sdkClient.AddUploadOperationWithPath(t, allocationID, "/dir1/"),
sdkClient.AddUploadOperationWithPath(t, allocationID, "/"),
sdkClient.AddUploadOperationWithPath(t, allocationID, "/"),
sdkClient.AddUploadOperationWithPath(t, allocationID, "/"),
}
sdkClient.MultiOperation(t, allocationID, ops, client.WithRepair(alloc.Blobbers))

// assert both upload and download size should be 2KB in /dir1
rs, err := alloc.RepairSize("/dir1")
require.Nilf(t, err, "error getting repair size in /dir1: %v", err)
t.Logf("repair size: %v", rs)
require.Equal(t, uint64(1024 * 2), rs.UploadSize, "upload size in directory /dir1 doesn't match")
require.Equal(t, uint64(1024 * 2), rs.DownloadSize, "download size in directory dir1 doesn't match")
require.Equal(t, uint64(1024*2), rs.UploadSize, "upload size in directory /dir1 doesn't match")
require.Equal(t, uint64(1024*2), rs.DownloadSize, "download size in directory dir1 doesn't match")

// with trailing slash
// assert both upload and download size should be 2KB in /dir1/
// assert both upload and download size should be 2KB in /dir1/
rs, err = alloc.RepairSize("/dir1/")
require.Nilf(t, err, "error getting repair size in /dir1/: %v", err)
t.Logf("repair size: %v", rs)
require.Equal(t, uint64(1024 * 2), rs.UploadSize, "upload size in directory /dir1/ doesn't match")
require.Equal(t, uint64(1024 * 2), rs.DownloadSize, "download size in directory /dir1/ doesn't match")
require.Equal(t, uint64(1024*2), rs.UploadSize, "upload size in directory /dir1/ doesn't match")
require.Equal(t, uint64(1024*2), rs.DownloadSize, "download size in directory /dir1/ doesn't match")

// assert both upload and download size should be 4KB in root directory
rs, err = alloc.RepairSize("/")
require.Nilf(t, err, "error getting repair size in /: %v", err)
t.Logf("repair size: %v", rs)
require.Equal(t, uint64(1024 * 4), rs.UploadSize, "upload size in root directory doesn't match")
require.Equal(t, uint64(1024 * 4), rs.DownloadSize, "download size in root directory doesn't match")
require.Equal(t, uint64(1024*4), rs.UploadSize, "upload size in root directory doesn't match")
require.Equal(t, uint64(1024*4), rs.DownloadSize, "download size in root directory doesn't match")
})
}
}
32 changes: 25 additions & 7 deletions tests/cli_tests/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,21 +50,30 @@ func InitSDK(wallet, configFile string) error {
return err
}

// GetBlobberNotPartOfAllocation returns a blobber not part of current allocation
func GetBlobberNotPartOfAllocation(walletname, configFile, allocationID string) (string, error) {
err := InitSDK(walletname, configFile)
// GetBlobberIDNotPartOfAllocation returns a blobber not part of current allocation
func GetBlobberIDNotPartOfAllocation(walletname, configFile, allocationID string) (string, error) {
blobber, err := getBlobberNotPartOfAllocation(walletname, configFile, allocationID)

if err != nil {
return "", err
}
return string(blobber.ID), err
}

func getBlobberNotPartOfAllocation(walletname, configFile, allocationID string) (*sdk.Blobber, error) {
err := InitSDK(walletname, configFile)
if err != nil {
return nil, err
}

a, err := sdk.GetAllocation(allocationID)
if err != nil {
return "", err
return nil, err
}

blobbers, err := sdk.GetBlobbers(true, false)
if err != nil {
return "", err
return nil, err
}

allocationBlobsMap := map[string]bool{}
Expand All @@ -74,11 +83,20 @@ func GetBlobberNotPartOfAllocation(walletname, configFile, allocationID string)

for _, blobber := range blobbers {
if _, ok := allocationBlobsMap[string(blobber.ID)]; !ok {
return string(blobber.ID), nil
return blobber, nil
}
}

return "", fmt.Errorf("failed to get blobber not part of allocation")
return nil, fmt.Errorf("failed to get blobber not part of allocation")
}

// GetBlobberIdAndUrlNotPartOfAllocation returns a blobber not part of current allocation
func GetBlobberIdAndUrlNotPartOfAllocation(walletName, configFile, allocationID string) (blobberId, blobberUrl string, err error) {
blobber, err := getBlobberNotPartOfAllocation(walletName, configFile, allocationID)
if err != nil || blobber == nil {
return "", "", err
}
return string(blobber.ID), blobber.BaseURL, err
}

func generateRandomIndex(sliceLen int64) (*big.Int, error) {
Expand Down
Loading
Loading