Skip to content

Commit 7d30816

Browse files
committed
chore(tests): restore the full test matrix and drop debugging scaffolding
Signed-off-by: ValentinVPK <valentin.krumov@limechain.tech>
1 parent 54f606c commit 7d30816

9 files changed

Lines changed: 295 additions & 447 deletions

File tree

.github/workflows/tests.yml

Lines changed: 117 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,5 @@
11
name: Tests CI
22

3-
# =============================================================================
4-
# TEMPORARY — v0.77 fix iteration only. REVERT BEFORE MERGE.
5-
# Reduced to a single suite so each push runs one ~5-min job instead of 14
6-
# suites (most hanging to the job cap) on a serialized runner pool. To iterate a
7-
# different suite, change `testfilter` below. To restore the full 14-job matrix
8-
# + PublishResults before this PR is merged:
9-
# git checkout origin/main -- .github/workflows/tests.yml
10-
# =============================================================================
11-
123
on:
134
pull_request:
145
branches: [main, release/**]
@@ -30,8 +21,125 @@ defaults:
3021
shell: bash
3122

3223
jobs:
24+
ERC20Contract:
25+
name: ERC20 Contract Test Suite
26+
uses: ./.github/workflows/test-workflow.yml
27+
with:
28+
testfilter: ERC20
29+
30+
ERC721Contract:
31+
name: ERC721 Contract Test Suite
32+
uses: ./.github/workflows/test-workflow.yml
33+
with:
34+
testfilter: ERC721
35+
36+
TokenCreateContract:
37+
name: Token Create Test Suite
38+
uses: ./.github/workflows/test-workflow.yml
39+
with:
40+
testfilter: TokenCreateContract
41+
42+
TokenQueryContract:
43+
name: Token Query Test Suite
44+
uses: ./.github/workflows/test-workflow.yml
45+
with:
46+
testfilter: TokenQueryContract
47+
3348
TokenManagmentContract:
3449
name: Token Managment Test Suite
3550
uses: ./.github/workflows/test-workflow.yml
3651
with:
3752
testfilter: TokenManagmentContract
53+
54+
TokenTransferContract:
55+
name: Token Transfer Test Suite
56+
uses: ./.github/workflows/test-workflow.yml
57+
with:
58+
testfilter: TokenTransferContract
59+
60+
HIP755:
61+
name: HIP755 Test Suite
62+
uses: ./.github/workflows/test-workflow.yml
63+
with:
64+
testfilter: HIP755
65+
66+
HIP1215:
67+
name: HIP1215 Test Suite
68+
uses: ./.github/workflows/test-workflow.yml
69+
with:
70+
testfilter: HIP1215
71+
72+
HRC:
73+
name: HRC Test Suite
74+
uses: ./.github/workflows/test-workflow.yml
75+
with:
76+
testfilter: HRC
77+
78+
PrngSystemContract:
79+
name: PrngSystemContract Test Suite
80+
uses: ./.github/workflows/test-workflow.yml
81+
with:
82+
testfilter: PrngSystemContract
83+
84+
HederaAccountService:
85+
name: HederaAccountService Test Suite
86+
uses: ./.github/workflows/test-workflow.yml
87+
with:
88+
testfilter: HAS
89+
90+
HIP904Batch1:
91+
name: HIP904 Contract Test Suite Batch 1
92+
uses: ./.github/workflows/test-workflow.yml
93+
with:
94+
testfilter: HIP904Batch1
95+
96+
HIP904Batch2:
97+
name: HIP904 Contract Test Suite Batch 2
98+
uses: ./.github/workflows/test-workflow.yml
99+
with:
100+
testfilter: HIP904Batch2
101+
102+
HIP904Batch3:
103+
name: HIP904 Contract Test Suite Batch 3
104+
uses: ./.github/workflows/test-workflow.yml
105+
with:
106+
testfilter: HIP904Batch3
107+
108+
PublishResults:
109+
name: Publish Results
110+
if: ${{ !cancelled() }}
111+
needs:
112+
- ERC20Contract
113+
- ERC721Contract
114+
- TokenCreateContract
115+
- TokenQueryContract
116+
- TokenManagmentContract
117+
- TokenTransferContract
118+
- HIP755
119+
- HIP1215
120+
- HRC
121+
- PrngSystemContract
122+
- HederaAccountService
123+
- HIP904Batch1
124+
- HIP904Batch2
125+
- HIP904Batch3
126+
127+
runs-on: hl-contr-lin-md
128+
steps:
129+
- name: Harden Runner
130+
uses: step-security/harden-runner@bf7454d06d71f1098171f2acdf0cd4708d7b5920 # v2.20.0
131+
with:
132+
egress-policy: audit
133+
134+
- name: Download Test Reports
135+
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
136+
with:
137+
pattern: Test Results (*)
138+
merge-multiple: true
139+
140+
- name: Publish Test Report
141+
uses: step-security/publish-unit-test-result-action@681100d67b09305624c089873f12c545ee7cbc24 # v2.23.0
142+
with:
143+
check_name: Test Results
144+
json_thousands_separator: ','
145+
junit_files: 'test-*.xml'

test/exit-watchdog.js

Lines changed: 0 additions & 14 deletions
This file was deleted.

test/token-service/erc-20/IERC20.js

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,43 +19,29 @@ describe('IERC20 Test Suite', function () {
1919
const AMOUNT = BigInt(33);
2020

2121
before(async function () {
22-
this.timeout(180000); // [diag] bound the hook so a hang flushes instead of eating the 45m job cap
23-
console.log('[diag] ierc20: getSigners');
2422
signers = await ethers.getSigners();
25-
console.log('[diag] ierc20: deployTokenCreateContract');
2623
tokenCreateContract = await utils.deployTokenCreateContract();
2724
// v0.77: these are direct EOA ERC20 calls — signer0/signer1 own and move
2825
// their OWN tokens, so they must stay plain-ECDSA senders (no
2926
// updateAccountKeys). Create the token via the SDK with signer0 as treasury,
3027
// so no contract intermediary needs a KeyList on those accounts.
31-
console.log('[diag] ierc20: createFungibleTokenViaSdk');
3228
tokenAddress = await hapi.createFungibleTokenViaSdk(0);
33-
console.log('[diag] ierc20: created token ' + tokenAddress);
3429
await sleep();
3530
// signer1 self-associates (SDK, signed by its own key); the contract used as
3631
// the transferFrom recipient associates itself.
37-
console.log('[diag] ierc20: associateWithSigner(signer1)');
3832
await hapi.associateWithSigner(
3933
utils.getHardhatSignerPrivateKeyByIndex(1),
4034
tokenAddress,
4135
);
42-
console.log('[diag] ierc20: contract self-associate');
43-
try {
44-
await tokenCreateContract.associateTokenPublic(
45-
await tokenCreateContract.getAddress(),
46-
tokenAddress,
47-
Constants.GAS_LIMIT_1_000_000,
48-
);
49-
} catch (err) {
50-
utils.logRelayError('ierc20:self-associate', err);
51-
throw err;
52-
}
53-
console.log('[diag] ierc20: getContractAt');
36+
await tokenCreateContract.associateTokenPublic(
37+
await tokenCreateContract.getAddress(),
38+
tokenAddress,
39+
Constants.GAS_LIMIT_1_000_000,
40+
);
5441
IERC20 = await ethers.getContractAt(
5542
Constants.Contract.ERC20Mock,
5643
tokenAddress,
5744
);
58-
console.log('[diag] ierc20: before DONE');
5945
});
6046

6147
after(function () {

test/token-service/erc-721/ERC721Contract.js

Lines changed: 30 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -16,83 +16,58 @@ describe('ERC721Contract Test Suite', function () {
1616
let signers, firstWallet, secondWallet;
1717

1818
before(async function () {
19-
this.timeout(180000); // [diag] bound the hook so a hang flushes instead of eating the 45m job cap
20-
const step = async (label, fn) => {
21-
console.log('[diag] erc721c: ' + label);
22-
try {
23-
return await fn();
24-
} catch (err) {
25-
utils.logRelayError('erc721c:' + label, err);
26-
throw err;
27-
}
28-
};
2919
signers = await ethers.getSigners();
3020
firstWallet = signers[0];
3121
secondWallet = signers[1];
32-
tokenCreateContract = await step('deployTokenCreateContract', () =>
33-
utils.deployTokenCreateContract(),
34-
);
35-
erc721Contract = await step('deployERC721Contract', () =>
36-
utils.deployERC721Contract(),
37-
);
22+
tokenCreateContract = await utils.deployTokenCreateContract();
23+
erc721Contract = await utils.deployERC721Contract();
3824
const tokenCreateAddr = await tokenCreateContract.getAddress();
3925
const erc721Addr = await erc721Contract.getAddress();
4026
// Relay model: no account re-keying. The token is precompile-created (so the
4127
// contract can read its ERC721 facade) with the CONTRACT as treasury — a
4228
// contract authorizes itself, whereas an EOA treasury would need re-keying.
43-
tokenAddress = await step('createNonFungibleToken', () =>
44-
utils.createNonFungibleToken(tokenCreateContract, tokenCreateAddr),
29+
tokenAddress = await utils.createNonFungibleToken(
30+
tokenCreateContract,
31+
tokenCreateAddr,
4532
);
4633
// Recipients must be associated + KYC-granted. Signers self-associate with
4734
// their own key; the contract holds the inherited KYC key so it grants KYC
4835
// without the target signing.
49-
await step('associate firstWallet', () =>
50-
hapi.associateWithSigner(
51-
utils.getHardhatSignerPrivateKeyByIndex(0),
52-
tokenAddress,
53-
),
36+
await hapi.associateWithSigner(
37+
utils.getHardhatSignerPrivateKeyByIndex(0),
38+
tokenAddress,
5439
);
55-
await step('associate secondWallet', () =>
56-
hapi.associateWithSigner(
57-
utils.getHardhatSignerPrivateKeyByIndex(1),
58-
tokenAddress,
59-
),
40+
await hapi.associateWithSigner(
41+
utils.getHardhatSignerPrivateKeyByIndex(1),
42+
tokenAddress,
6043
);
61-
await step('grantKyc firstWallet', () =>
62-
tokenCreateContract.grantTokenKycPublic(
63-
tokenAddress,
64-
firstWallet.address,
65-
Constants.GAS_LIMIT_1_000_000,
66-
),
44+
await tokenCreateContract.grantTokenKycPublic(
45+
tokenAddress,
46+
firstWallet.address,
47+
Constants.GAS_LIMIT_1_000_000,
6748
);
68-
await step('grantKyc secondWallet', () =>
69-
tokenCreateContract.grantTokenKycPublic(
70-
tokenAddress,
71-
secondWallet.address,
72-
Constants.GAS_LIMIT_1_000_000,
73-
),
49+
await tokenCreateContract.grantTokenKycPublic(
50+
tokenAddress,
51+
secondWallet.address,
52+
Constants.GAS_LIMIT_1_000_000,
7453
);
75-
await step('associate erc721Contract', () =>
76-
tokenCreateContract.associateTokenPublic(
77-
erc721Addr,
78-
tokenAddress,
79-
Constants.GAS_LIMIT_1_000_000,
80-
),
54+
await tokenCreateContract.associateTokenPublic(
55+
erc721Addr,
56+
tokenAddress,
57+
Constants.GAS_LIMIT_1_000_000,
8158
);
82-
await step('grantKyc erc721Contract', () =>
83-
tokenCreateContract.grantTokenKycPublic(
84-
tokenAddress,
85-
erc721Addr,
86-
Constants.GAS_LIMIT_1_000_000,
87-
),
59+
await tokenCreateContract.grantTokenKycPublic(
60+
tokenAddress,
61+
erc721Addr,
62+
Constants.GAS_LIMIT_1_000_000,
8863
);
8964
// Mint straight to firstWallet: the treasury contract mints then transfers
9065
// the NFT to msg.sender (firstWallet, the tx sender), authorized as owner.
91-
mintedTokenSerialNumber = await step('mintNFTToAddress firstWallet', () =>
92-
utils.mintNFTToAddress(tokenCreateContract, tokenAddress),
66+
mintedTokenSerialNumber = await utils.mintNFTToAddress(
67+
tokenCreateContract,
68+
tokenAddress,
9369
);
9470
nftInitialOwnerAddress = firstWallet.address;
95-
console.log('[diag] erc721c: before DONE');
9671
});
9772

9873
after(function () {

0 commit comments

Comments
 (0)