From 58a8edcf2c34d10756ef725ac7640c402b48b6d1 Mon Sep 17 00:00:00 2001 From: yash10019coder Date: Fri, 3 Jan 2025 23:15:35 +0530 Subject: [PATCH 1/5] refactor: remove read price tests. --- ...terprise_blobber_create_allocation_test.go | 45 ------------------- 1 file changed, 45 deletions(-) diff --git a/tests/tokenomics_tests/enterprise_blobber_create_allocation_test.go b/tests/tokenomics_tests/enterprise_blobber_create_allocation_test.go index 546438dfdf..f698252e74 100644 --- a/tests/tokenomics_tests/enterprise_blobber_create_allocation_test.go +++ b/tests/tokenomics_tests/enterprise_blobber_create_allocation_test.go @@ -228,34 +228,6 @@ func TestCreateEnterpriseAllocation(testSetup *testing.T) { createEnterpriseAllocationTestTeardown(t, allocationID) }) - t.Run("Create enterprise allocation with read price range Should Work", func(t *test.SystemTest) { - output, err := utils.CreateWallet(t, configPath) - require.Nil(t, err, "Error registering wallet", strings.Join(output, "\n")) - - _, err = utils.ExecuteFaucetWithTokens(t, configPath, 10) - require.Nil(t, err, "Error executing faucet") - - blobberAuthTickets, blobberIds := utils.GenerateBlobberAuthTickets(t, configPath) - - options := map[string]interface{}{ - "size": "1024", - "read_price": "0-9999", - "lock": "0.5", - "enterprise": true, - "blobber_auth_tickets": blobberAuthTickets, - "preferred_blobbers": blobberIds, - } - output, err = createNewEnterpriseAllocation(t, configPath, utils.CreateParams(options)) - require.Nil(t, err, strings.Join(output, "\n")) - require.True(t, len(output) > 0, "expected output length be at least 1") - require.Regexp(t, regexp.MustCompile("^Allocation created: [0-9a-fA-F]{64}$"), output[0], strings.Join(output, "\n")) - - allocationID, err := utils.GetAllocationID(output[0]) - require.Nil(t, err, "could not get allocation ID", strings.Join(output, "\n")) - - createEnterpriseAllocationTestTeardown(t, allocationID) - }) - t.Run("Create enterprise allocation with write price range Should Work", func(t *test.SystemTest) { output, err := utils.CreateWallet(t, configPath) require.Nil(t, err, "Error registering wallet", strings.Join(output, "\n")) @@ -598,23 +570,6 @@ func TestCreateEnterpriseAllocation(testSetup *testing.T) { require.Contains(t, output[0], "blobbers provided are not enough to honour the allocation") //nolint }) - t.Run("Create enterprise allocation with read price range 0-0 Should Fail", func(t *test.SystemTest) { - output, err := utils.CreateWallet(t, configPath) - require.Nil(t, err, "Error registering wallet", strings.Join(output, "\n")) - - _, err = utils.ExecuteFaucetWithTokens(t, configPath, 10) - require.Nil(t, err, "Error executing faucet") - - blobberAuthTickets, blobberIds := utils.GenerateBlobberAuthTickets(t, configPath) - - options := map[string]interface{}{"read_price": "0-0", "lock": "0.5", "size": 1024, "enterprise": true, "blobber_auth_tickets": blobberAuthTickets, - "preferred_blobbers": blobberIds} - output, err = createNewEnterpriseAllocationWithoutRetry(t, configPath, utils.CreateParams(options)) - require.NotNil(t, err, strings.Join(output, "\n")) - require.True(t, len(output) > 0, "expected output length be at least 1") - require.Contains(t, output[0], "Not enough blobbers to honor the allocation", strings.Join(output, "\n")) - }) - t.Run("Create enterprise allocation with size smaller than limit (size < 1024) Should Fail", func(t *test.SystemTest) { output, err := utils.CreateWallet(t, configPath) require.Nil(t, err, "Error registering wallet", strings.Join(output, "\n")) From f429b6101f12d7278a797481b902e331f331b76b Mon Sep 17 00:00:00 2001 From: yash10019coder Date: Fri, 3 Jan 2025 23:41:15 +0530 Subject: [PATCH 2/5] disable slack notifiy. --- .../enterprise-blobbers-tokenomics_ci.yml | 70 +++++++++---------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/.github/workflows/enterprise-blobbers-tokenomics_ci.yml b/.github/workflows/enterprise-blobbers-tokenomics_ci.yml index 5227144a8c..89e53eb7b0 100644 --- a/.github/workflows/enterprise-blobbers-tokenomics_ci.yml +++ b/.github/workflows/enterprise-blobbers-tokenomics_ci.yml @@ -174,38 +174,38 @@ jobs: S3_SECRET_KEY: ${{ secrets.S3_SECRET_KEY }} TENDERLY_VIRTUAL_TESTNET_RPC_ID: "" - notify_slack_on_failure: - runs-on: [ self-hosted, arc-runner ] - needs: [ system-tests ] - if: always() && (needs.system-tests.result == 'failure') - steps: - - name: "Notify Slack" - run: | - payload='{ - "text": "'" Enterprise Blobber Tokenomics Nightly Tests - Current Sprint FAILED on $(echo ${GITHUB_REF#refs/heads/})!.\n View the test results on Github: https://github.com/0chain/system_test/actions/runs/${{ github.run_id }}"'", - "attachments": [ - { - "text": "Enterprise Blobber Tokenomics Nightly Tests - Current sprint: FAILED ⚠️", - "color": "#ff0000" - } - ] - }' - 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 ] - if: always() && (needs.system-tests.result == 'success') - steps: - - name: "Notify Slack" - run: | - payload='{ - "text": "'" Enterprise Blobber Tokenomics Nightly Tests - Current Sprint PASSING on $(echo ${GITHUB_REF#refs/heads/})!.\n View the test results on Github: https://github.com/0chain/system_test/actions/runs/${{ github.run_id }}"'", - "attachments": [ - { - "text": "Enterprise Blobber Tokenomics Nightly Tests - Current sprint: PASSED ✅", - "color": "#22bb33" - } - ] - }' - curl -X POST -H 'Content-type: application/json' --data "${payload}" ${{ secrets.DEVOPS_CHANNEL_WEBHOOK_URL }} +# notify_slack_on_failure: +# runs-on: [ self-hosted, arc-runner ] +# needs: [ system-tests ] +# if: always() && (needs.system-tests.result == 'failure') +# steps: +# - name: "Notify Slack" +# run: | +# payload='{ +# "text": "'" Enterprise Blobber Tokenomics Nightly Tests - Current Sprint FAILED on $(echo ${GITHUB_REF#refs/heads/})!.\n View the test results on Github: https://github.com/0chain/system_test/actions/runs/${{ github.run_id }}"'", +# "attachments": [ +# { +# "text": "Enterprise Blobber Tokenomics Nightly Tests - Current sprint: FAILED ⚠️", +# "color": "#ff0000" +# } +# ] +# }' +# 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 ] +# if: always() && (needs.system-tests.result == 'success') +# steps: +# - name: "Notify Slack" +# run: | +# payload='{ +# "text": "'" Enterprise Blobber Tokenomics Nightly Tests - Current Sprint PASSING on $(echo ${GITHUB_REF#refs/heads/})!.\n View the test results on Github: https://github.com/0chain/system_test/actions/runs/${{ github.run_id }}"'", +# "attachments": [ +# { +# "text": "Enterprise Blobber Tokenomics Nightly Tests - Current sprint: PASSED ✅", +# "color": "#22bb33" +# } +# ] +# }' +# curl -X POST -H 'Content-type: application/json' --data "${payload}" ${{ secrets.DEVOPS_CHANNEL_WEBHOOK_URL }} From b1792570521114353a4e1bb2ce3374c95e355265 Mon Sep 17 00:00:00 2001 From: yash10019coder Date: Fri, 3 Jan 2025 23:53:07 +0530 Subject: [PATCH 3/5] debug. --- .github/workflows/enterprise-blobbers-tokenomics_ci.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/enterprise-blobbers-tokenomics_ci.yml b/.github/workflows/enterprise-blobbers-tokenomics_ci.yml index 89e53eb7b0..09efe8ee95 100644 --- a/.github/workflows/enterprise-blobbers-tokenomics_ci.yml +++ b/.github/workflows/enterprise-blobbers-tokenomics_ci.yml @@ -71,6 +71,7 @@ jobs: repo_snapshots_branch: "${{ env.REPO_SNAPSHOTS_BRANCH }}" network: ${{ env.NETWORK_URL }} svc_account_secret: ${{ secrets.SVC_ACCOUNT_SECRET }} + system_tests_branch: fix/enterprise-blobber-tests deploy_report_page: true archive_results: true custom_go_sdk_version: feat/enterprise-blobber @@ -93,6 +94,7 @@ jobs: network: ${{ env.NETWORK_URL }} svc_account_secret: ${{ secrets.SVC_ACCOUNT_SECRET }} deploy_report_page: true + system_tests_branch: fix/enterprise-blobber-tests archive_results: true run_flaky_tests: false custom_go_sdk_version: feat/enterprise-blobber @@ -115,6 +117,7 @@ jobs: network: ${{ env.NETWORK_URL }} svc_account_secret: ${{ secrets.SVC_ACCOUNT_SECRET }} deploy_report_page: true + system_tests_branch: fix/enterprise-blobber-tests archive_results: true run_flaky_tests: false run_api_system_tests: false @@ -138,6 +141,7 @@ jobs: svc_account_secret: ${{ secrets.SVC_ACCOUNT_SECRET }} deploy_report_page: true archive_results: true + system_tests_branch: fix/enterprise-blobber-tests run_flaky_tests: false run_api_system_tests: false custom_go_sdk_version: feat/enterprise-blobber @@ -160,6 +164,7 @@ jobs: svc_account_secret: ${{ secrets.SVC_ACCOUNT_SECRET }} deploy_report_page: true archive_results: true + system_tests_branch: fix/enterprise-blobber-tests run_flaky_tests: false custom_go_sdk_version: feat/enterprise-blobber zbox_cli_branch: staging From 4cac85a4a12f971c6867ebc5a7a1e17aed48bf36 Mon Sep 17 00:00:00 2001 From: yash10019coder Date: Sun, 5 Jan 2025 18:45:15 +0530 Subject: [PATCH 4/5] add option to deploy enterprise blobbers. --- .github/workflows/ci-dev-st.yml | 11 +++++++---- .../enterprise_blobber_finalize_allocation_test.go | 6 +++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci-dev-st.yml b/.github/workflows/ci-dev-st.yml index a8d895c010..8f33f1a9b6 100644 --- a/.github/workflows/ci-dev-st.yml +++ b/.github/workflows/ci-dev-st.yml @@ -11,6 +11,9 @@ on: description: 'branch of repo-snapshots to derive images and branches from.' default: 'current-sprint' required: true + is_enterprise: + description: 'deploy network with enterprise blobbers' + default: false existing_network: description: '(OPTIONAL): *EXISTING NETWORK* to run system tests against *INSTEAD OF* deploying a new network. [example: dev.0chain.net]' default: '' @@ -78,15 +81,15 @@ jobs: force: 'false' - name: "Deploy 0Chain" - if: github.event_name == 'push' || github.event.inputs.existing_network == '' - uses: 0chain/actions/deploy-0chain@master + uses: 0chain/actions/deploy-0chain@feature/add-egosdk-tokenomics-action with: repo_snapshots_branch: "${{ env.REPO_SNAPSHOTS_BRANCH }}" - kube_config: ${{ secrets[format('DEVSTKC', env.RUNNER_NUMBER)] }} + kube_config: ${{ secrets[format('DEVKC', env.RUNNER_NUMBER)] }} teardown_condition: "TESTS_PASSED" SUBGRAPH_API_URL: ${{ secrets.SUBGRAPH_API_URL }} + is_enterprise_blobbers: '${{ inputs.is_enterprise }}' TENDERLY_VIRTUAL_TESTNET_RPC_ID: "" graphnode_sc: ${{ secrets.GRAPHNODE_SC }} graphnode_network: ${{ secrets.GRAPHNODE_NETWORK }} graphnode_ethereum_node_url: "" - svc_account_secret: ${{ secrets.SVC_ACCOUNT_SECRET }} \ No newline at end of file + svc_account_secret: ${{ secrets.SVC_ACCOUNT_SECRET }} diff --git a/tests/tokenomics_tests/enterprise_blobber_finalize_allocation_test.go b/tests/tokenomics_tests/enterprise_blobber_finalize_allocation_test.go index a7f4978410..b30bd9b807 100644 --- a/tests/tokenomics_tests/enterprise_blobber_finalize_allocation_test.go +++ b/tests/tokenomics_tests/enterprise_blobber_finalize_allocation_test.go @@ -36,7 +36,7 @@ func TestFinalizeEnterpriseAllocation(testSetup *testing.T) { require.Nil(t, err, "Error updating sc config", strings.Join(output, "\n")) }) - t.RunWithTimeout("Finalize allocation after waiting for 11 minutes check finalization and balance.", time.Minute*20, func(t *test.SystemTest) { + t.RunWithTimeout("Finalize allocation after waiting for 7 minutes check finalization and balance.", time.Minute*20, func(t *test.SystemTest) { utils.SetupWalletWithCustomTokens(t, configPath, 10) wallet, err := utils.GetWalletForName(t, configPath, utils.EscapedTestName(t)) @@ -62,7 +62,7 @@ func TestFinalizeEnterpriseAllocation(testSetup *testing.T) { beforeBalance = afterBalance t.Log("Waiting for 11 minutes ....") - waitForTimeInMinutesWhileLogging(t, 11) + waitForTimeInMinutesWhileLogging(t, 7) // Finalize the allocation output, err := finalizeAllocation(t, configPath, allocationID, true) @@ -141,7 +141,7 @@ func TestFinalizeEnterpriseAllocation(testSetup *testing.T) { output, err := utils.UpdateAllocation(t, configPath, updateAllocationParams, true) require.Nil(t, err, "Updating allocation duration failed", strings.Join(output, "\n")) - waitForTimeInMinutesWhileLogging(t, 11) + waitForTimeInMinutesWhileLogging(t, 7) // Finalize the allocation output, err = finalizeAllocation(t, configPath, allocationID, true) From 8496f0f1436ba426cbfb737edfff5dc1cca1048d Mon Sep 17 00:00:00 2001 From: yash10019coder Date: Sun, 5 Jan 2025 23:26:43 +0530 Subject: [PATCH 5/5] debug --- .github/workflows/ci-dev-st.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci-dev-st.yml b/.github/workflows/ci-dev-st.yml index 8f33f1a9b6..bbb80c52e9 100644 --- a/.github/workflows/ci-dev-st.yml +++ b/.github/workflows/ci-dev-st.yml @@ -84,7 +84,7 @@ jobs: uses: 0chain/actions/deploy-0chain@feature/add-egosdk-tokenomics-action with: repo_snapshots_branch: "${{ env.REPO_SNAPSHOTS_BRANCH }}" - kube_config: ${{ secrets[format('DEVKC', env.RUNNER_NUMBER)] }} + kube_config: ${{ secrets[format('DEVSTKC', env.RUNNER_NUMBER)] }} teardown_condition: "TESTS_PASSED" SUBGRAPH_API_URL: ${{ secrets.SUBGRAPH_API_URL }} is_enterprise_blobbers: '${{ inputs.is_enterprise }}'