Skip to content

Commit 3e76292

Browse files
authored
Merge pull request #44 from algorandfoundation/refactor/compile-on-demand
refactor: compile contracts used by tests on demand as part of test run
2 parents ec1a0b5 + 0a7d133 commit 3e76292

File tree

108 files changed

+159
-30624
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+159
-30624
lines changed

.github/workflows/pr.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ on:
99
- 'docs/**'
1010
- 'scripts/**'
1111

12-
1312
permissions:
1413
contents: read
1514

@@ -19,8 +18,9 @@ jobs:
1918
uses: ./.github/workflows/node-ci.yml
2019
with:
2120
pre-test-script: |
22-
pipx install algokit
23-
algokit localnet start
21+
pipx install algokit --python 3.12.6
22+
algokit localnet reset --update
23+
pipx install puyapy --python 3.12.6
2424
node-version: 20.x
2525
run-build: true
2626
run-commit-lint: true

package-lock.json

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
"eslint": "9.12.0",
5151
"eslint-config-prettier": "^9.1.0",
5252
"eslint-plugin-prettier": "^5.2.1",
53+
"glob": "^11.0.0",
5354
"npm-run-all": "4.1.5",
5455
"patch-package": "^8.0.0",
5556
"polytype": "^0.17.0",
@@ -59,6 +60,7 @@
5960
"semantic-release": "^24.1.2",
6061
"tsx": "4.19.1",
6162
"typescript": "^5.7.2",
63+
"upath": "^2.0.1",
6264
"vitest": "2.1.2"
6365
},
6466
"peerDependencies": {

tests/arc4/bool.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { getAvmResult } from '../avm-invoker'
88
import { createArc4TestFixture } from '../test-fixture'
99

1010
describe('arc4.Bool', async () => {
11-
const [test, localnetFixture] = createArc4TestFixture('tests/artifacts/arc4-primitive-ops/data/Arc4PrimitiveOpsContract.arc56.json', {
11+
const [test, localnetFixture] = createArc4TestFixture('tests/artifacts/arc4-primitive-ops/contract.algo.ts', {
1212
Arc4PrimitiveOpsContract: { deployParams: { createParams: { extraProgramPages: undefined } } },
1313
})
1414
const ctx = new TestExecutionContext()

tests/arc4/byte.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { createArc4TestFixture } from '../test-fixture'
1111

1212
const invalidBytesLengthError = 'byte string must be 1 byte long'
1313
describe('arc4.Byte', async () => {
14-
const [test, localnetFixture] = createArc4TestFixture('tests/artifacts/arc4-primitive-ops/data/Arc4PrimitiveOpsContract.arc56.json', {
14+
const [test, localnetFixture] = createArc4TestFixture('tests/artifacts/arc4-primitive-ops/contract.algo.ts', {
1515
Arc4PrimitiveOpsContract: { deployParams: { createParams: { extraProgramPages: undefined } } },
1616
})
1717

tests/arc4/emit.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class SwappedArc4 extends arc4.Struct<{
4141
}> {}
4242

4343
describe('arc4.emit', async () => {
44-
const [test, localnetFixture] = createArc4TestFixture('tests/artifacts/arc4-primitive-ops/data/Arc4PrimitiveOpsContract.arc56.json', {
44+
const [test, localnetFixture] = createArc4TestFixture('tests/artifacts/arc4-primitive-ops/contract.algo.ts', {
4545
Arc4PrimitiveOpsContract: { deployParams: { createParams: { extraProgramPages: undefined } } },
4646
})
4747
const ctx = new TestExecutionContext()

tests/arc4/str.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { getAvmResult } from '../avm-invoker'
99
import { createArc4TestFixture } from '../test-fixture'
1010

1111
describe('arc4.Str', async () => {
12-
const [test, localnetFixture] = createArc4TestFixture('tests/artifacts/arc4-primitive-ops/data/Arc4PrimitiveOpsContract.arc56.json', {
12+
const [test, localnetFixture] = createArc4TestFixture('tests/artifacts/arc4-primitive-ops/contract.algo.ts', {
1313
Arc4PrimitiveOpsContract: { deployParams: { createParams: { extraProgramPages: undefined } } },
1414
})
1515
const ctx = new TestExecutionContext()

tests/arc4/ufixednxm.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { createArc4TestFixture } from '../test-fixture'
1111

1212
const invalidBytesLengthError = (length: number) => `byte string must correspond to a ufixed${length}`
1313
describe('arc4.UFixedNxM', async () => {
14-
const [test, localnetFixture] = createArc4TestFixture('tests/artifacts/arc4-primitive-ops/data/Arc4PrimitiveOpsContract.arc56.json', {
14+
const [test, localnetFixture] = createArc4TestFixture('tests/artifacts/arc4-primitive-ops/contract.algo.ts', {
1515
Arc4PrimitiveOpsContract: { deployParams: { createParams: { extraProgramPages: undefined } } },
1616
})
1717
const ctx = new TestExecutionContext()

tests/arc4/uintn.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { createArc4TestFixture } from '../test-fixture'
1212

1313
const invalidBytesLengthError = (length: number) => `byte string must correspond to a uint${length}`
1414
describe('arc4.UintN', async () => {
15-
const [test, localnetFixture] = createArc4TestFixture('tests/artifacts/arc4-primitive-ops/data/Arc4PrimitiveOpsContract.arc56.json', {
15+
const [test, localnetFixture] = createArc4TestFixture('tests/artifacts/arc4-primitive-ops/contract.algo.ts', {
1616
Arc4PrimitiveOpsContract: { deployParams: { createParams: { extraProgramPages: undefined } } },
1717
})
1818
const ctx = new TestExecutionContext()

0 commit comments

Comments
 (0)