Skip to content

Commit

Permalink
chore: divided hbar limtier tests into different batches (#3181)
Browse files Browse the repository at this point in the history
* chore: divided hbar limtier tests into different batches

Signed-off-by: Logan Nguyen <[email protected]>

* fix: fixed acceptance.yml

Signed-off-by: Logan Nguyen <[email protected]>

---------

Signed-off-by: Logan Nguyen <[email protected]>
  • Loading branch information
quiet-node authored and ebadiere committed Oct 31, 2024
1 parent 39a12e9 commit b57e6f7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/acceptance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,17 @@ jobs:
testfilter: ratelimiter
test_ws_server: true

hbarlimiter:
name: HBar Limiter
hbarlimiter_batch_1:
name: HBar Limiter Batch 1
uses: ./.github/workflows/acceptance-workflow.yml
with:
testfilter: hbarlimiter
testfilter: hbarlimiter_batch1

hbarlimiter_batch_2:
name: HBar Limiter Batch 2
uses: ./.github/workflows/acceptance-workflow.yml
with:
testfilter: hbarlimiter_batch2

tokencreate:
name: Token Create
Expand Down Expand Up @@ -115,7 +121,8 @@ jobs:
- api_batch_3
- erc20
- ratelimiter
- hbarlimiter
- hbarlimiter_batch_1
- hbarlimiter_batch_2
- tokencreate
- tokenmanagement
- htsprecompilev1
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
"acceptancetest:api_batch3": "nyc ts-mocha packages/server/tests/acceptance/index.spec.ts -g '@api-batch-3' --exit",
"acceptancetest:erc20": "nyc ts-mocha packages/server/tests/acceptance/index.spec.ts -g '@erc20' --exit",
"acceptancetest:ratelimiter": "nyc ts-mocha packages/ws-server/tests/acceptance/index.spec.ts -g '@web-socket-ratelimiter' --exit && ts-mocha packages/server/tests/acceptance/index.spec.ts -g '@ratelimiter' --exit",
"acceptancetest:hbarlimiter": "HBAR_RATE_LIMIT_TINYBAR=5000000000 HBAR_RATE_LIMIT_BASIC=1000000000 HBAR_RATE_LIMIT_EXTENDED=1500000000 HBAR_RATE_LIMIT_PRIVILEGED=2000000000 nyc ts-mocha packages/server/tests/acceptance/index.spec.ts -g '@hbarlimiter' --exit",
"acceptancetest:hbarlimiter_batch1": "HBAR_RATE_LIMIT_BASIC=1000000000 HBAR_RATE_LIMIT_EXTENDED=1500000000 HBAR_RATE_LIMIT_PRIVILEGED=2000000000 nyc ts-mocha packages/server/tests/acceptance/index.spec.ts -g '@hbarlimiter-batch1' --exit",
"acceptancetest:hbarlimiter_batch2": "HBAR_RATE_LIMIT_BASIC=1000000000 HBAR_RATE_LIMIT_EXTENDED=1500000000 HBAR_RATE_LIMIT_PRIVILEGED=2000000000 nyc ts-mocha packages/server/tests/acceptance/index.spec.ts -g '@hbarlimiter-batch2' --exit",
"acceptancetest:tokencreate": "nyc ts-mocha packages/server/tests/acceptance/index.spec.ts -g '@tokencreate' --exit",
"acceptancetest:tokenmanagement": "nyc ts-mocha packages/server/tests/acceptance/index.spec.ts -g '@tokenmanagement' --exit",
"acceptancetest:htsprecompilev1": "nyc ts-mocha packages/server/tests/acceptance/index.spec.ts -g '@htsprecompilev1' --exit",
Expand Down
6 changes: 3 additions & 3 deletions packages/server/tests/acceptance/hbarLimiter.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ describe('@hbarlimiter HBAR Limiter Acceptance Tests', function () {
}
});

describe('Total HBAR Limit', () => {
describe('@hbarlimiter-batch1 Total HBAR Limit', () => {
it('should execute "eth_sendRawTransaction" without triggering HBAR rate limit exceeded', async function () {
const parentContract = await deployContract(parentContractJson, accounts[0].wallet);

Expand Down Expand Up @@ -366,7 +366,7 @@ describe('@hbarlimiter HBAR Limiter Acceptance Tests', function () {
});

describe('HBAR Rate Limit For Different Spending Plan Tiers', () => {
describe('BASIC Tier', () => {
describe('@hbarlimiter-batch1 BASIC Tier', () => {
it('should create a BASIC spending plan for a new user and use the same plan on second transaction and different plan on third transaction from another user', async function () {
const parentContract = await deployContract(parentContractJson, accounts[0].wallet);
// awaiting for HBAR limiter to finish updating expenses in the background
Expand Down Expand Up @@ -506,7 +506,7 @@ describe('@hbarlimiter HBAR Limiter Acceptance Tests', function () {
});
});

describe('Preconfigured Tiers', () => {
describe('@hbarlimiter-batch2 Preconfigured Tiers', () => {
const createAliasForNonBasicPlans = async (subscriptionTier: SubscriptionTier) => {
const aliasAccount = await Utils.createAliasAccount(
mirrorNode,
Expand Down

0 comments on commit b57e6f7

Please sign in to comment.