Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: compile contracts used by tests on demand as part of test run #44

Merged
merged 2 commits into from
Jan 30, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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