Skip to content

Commit

Permalink
Merge pull request #44 from algorandfoundation/refactor/compile-on-de…
Browse files Browse the repository at this point in the history
…mand

refactor: compile contracts used by tests on demand as part of test run
  • Loading branch information
boblat authored Jan 30, 2025
2 parents ec1a0b5 + 0a7d133 commit 3e76292
Show file tree
Hide file tree
Showing 108 changed files with 159 additions and 30,624 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:
- 'docs/**'
- 'scripts/**'


permissions:
contents: read

Expand All @@ -19,8 +18,9 @@ jobs:
uses: ./.github/workflows/node-ci.yml
with:
pre-test-script: |
pipx install algokit
algokit localnet start
pipx install algokit --python 3.12.6
algokit localnet reset --update
pipx install puyapy --python 3.12.6
node-version: 20.x
run-build: true
run-commit-lint: true
Expand Down
2 changes: 2 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
"eslint": "9.12.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"glob": "^11.0.0",
"npm-run-all": "4.1.5",
"patch-package": "^8.0.0",
"polytype": "^0.17.0",
Expand All @@ -59,6 +60,7 @@
"semantic-release": "^24.1.2",
"tsx": "4.19.1",
"typescript": "^5.7.2",
"upath": "^2.0.1",
"vitest": "2.1.2"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion tests/arc4/bool.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { getAvmResult } from '../avm-invoker'
import { createArc4TestFixture } from '../test-fixture'

describe('arc4.Bool', async () => {
const [test, localnetFixture] = createArc4TestFixture('tests/artifacts/arc4-primitive-ops/data/Arc4PrimitiveOpsContract.arc56.json', {
const [test, localnetFixture] = createArc4TestFixture('tests/artifacts/arc4-primitive-ops/contract.algo.ts', {
Arc4PrimitiveOpsContract: { deployParams: { createParams: { extraProgramPages: undefined } } },
})
const ctx = new TestExecutionContext()
Expand Down
2 changes: 1 addition & 1 deletion tests/arc4/byte.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { createArc4TestFixture } from '../test-fixture'

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

Expand Down
2 changes: 1 addition & 1 deletion tests/arc4/emit.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class SwappedArc4 extends arc4.Struct<{
}> {}

describe('arc4.emit', async () => {
const [test, localnetFixture] = createArc4TestFixture('tests/artifacts/arc4-primitive-ops/data/Arc4PrimitiveOpsContract.arc56.json', {
const [test, localnetFixture] = createArc4TestFixture('tests/artifacts/arc4-primitive-ops/contract.algo.ts', {
Arc4PrimitiveOpsContract: { deployParams: { createParams: { extraProgramPages: undefined } } },
})
const ctx = new TestExecutionContext()
Expand Down
2 changes: 1 addition & 1 deletion tests/arc4/str.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { getAvmResult } from '../avm-invoker'
import { createArc4TestFixture } from '../test-fixture'

describe('arc4.Str', async () => {
const [test, localnetFixture] = createArc4TestFixture('tests/artifacts/arc4-primitive-ops/data/Arc4PrimitiveOpsContract.arc56.json', {
const [test, localnetFixture] = createArc4TestFixture('tests/artifacts/arc4-primitive-ops/contract.algo.ts', {
Arc4PrimitiveOpsContract: { deployParams: { createParams: { extraProgramPages: undefined } } },
})
const ctx = new TestExecutionContext()
Expand Down
2 changes: 1 addition & 1 deletion tests/arc4/ufixednxm.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { createArc4TestFixture } from '../test-fixture'

const invalidBytesLengthError = (length: number) => `byte string must correspond to a ufixed${length}`
describe('arc4.UFixedNxM', async () => {
const [test, localnetFixture] = createArc4TestFixture('tests/artifacts/arc4-primitive-ops/data/Arc4PrimitiveOpsContract.arc56.json', {
const [test, localnetFixture] = createArc4TestFixture('tests/artifacts/arc4-primitive-ops/contract.algo.ts', {
Arc4PrimitiveOpsContract: { deployParams: { createParams: { extraProgramPages: undefined } } },
})
const ctx = new TestExecutionContext()
Expand Down
2 changes: 1 addition & 1 deletion tests/arc4/uintn.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { createArc4TestFixture } from '../test-fixture'

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

0 comments on commit 3e76292

Please sign in to comment.