Skip to content

Commit

Permalink
Add CI tests for SimpleCounter using juvix-anoma-test (#4)
Browse files Browse the repository at this point in the history
  • Loading branch information
paulcadman authored Jul 15, 2024
1 parent e5807f4 commit a4f04aa
Show file tree
Hide file tree
Showing 9 changed files with 249 additions and 8 deletions.
25 changes: 25 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@

name: Test anoma-apps

on:
push:
branches: [ main ]
pull_request:
workflow_dispatch:

jobs:
test:
name: Run test suite
runs-on: ubuntu-latest
steps:
- name: checkout code
uses: actions/checkout@v3

- name: Download latest nightly Juvix binary
uses: jaxxstorm/[email protected]
with:
repo: anoma/juvix-nightly-builds
cache: enable

- name: Run tests
run: juvix eval tests/Main.juvix
5 changes: 1 addition & 4 deletions SimpleCounter/Package.juvix
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,5 @@ package : Package :=
defaultPackage
{name := "simplecounter";
dependencies := [ defaultStdlib
; github
"anoma"
"juvix-anoma-stdlib"
"b91e93a7582a7ac87e7756e39c28affc05926dca"
; github "anoma" "juvix-anoma-stdlib" "v0.1.0"
]};
11 changes: 7 additions & 4 deletions SimpleCounter/juvix.lock.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
# This file was autogenerated by Juvix version 0.6.2.
# This file was autogenerated by Juvix version 0.6.3.
# Do not edit this file manually.

version: 2
checksum: 3de3e44074cdb117abc190a223acabe27623e099f7d782ab3722b4032ab0a8dd
checksum: d4d7643f2d4d193af44a11088b92b852ae2fdc14d3be8b071aa8f1158f83c340
dependencies:
- path: .juvix-build/stdlib/
dependencies: []
- git:
name: anoma_juvix-anoma-stdlib
ref: b91e93a7582a7ac87e7756e39c28affc05926dca
ref: 835ce837e75c35319ab7e362953f23f1bc5fd3e5
url: https://github.com/anoma/juvix-anoma-stdlib
dependencies:
- path: .juvix-build/stdlib/
- git:
name: anoma_juvix-stdlib
ref: 89a5960fb8a29291e9271986b98ca7b1edf4031b
url: https://github.com/anoma/juvix-stdlib
dependencies: []
14 changes: 14 additions & 0 deletions SimpleCounter/tests/Package.juvix
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module Package;

import PackageDescription.V2 open;

package : Package :=
defaultPackage@?{
name := "simplecounter-tests";
dependencies :=
[ defaultStdlib
; github "anoma" "juvix-anoma-test" "v0.1.1"
; github "anoma" "juvix-test" "v0.11.0"
; path "../"
]
};
23 changes: 23 additions & 0 deletions SimpleCounter/tests/SimpleCounterTests.juvix
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
module SimpleCounterTests;

import Stdlib.Prelude open;
import Test.Anoma open;
import Test.JuvixUnit open;
import SimpleCounter open;

tests : List Test :=
[ testCase
"init counter with zeroedCounter is valid"
(anomaAssertPass (verify (init zeroedCounter)))
; testCase
"init counter with incrementedCounter is invalid"
(anomaAssertFail (verify (init incrementedCounter)))
; testCase
"update with zeroedCounter and incrementedCounter is valid"
(anomaAssertPass
(verify (update zeroedCounter incrementedCounter)))
; testCase
"update with zeroedCounter and zeroedCounter is invalid"
(anomaAssertFail
(verify (update zeroedCounter zeroedCounter)))
];
72 changes: 72 additions & 0 deletions SimpleCounter/tests/juvix.lock.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# This file was autogenerated by Juvix version 0.6.3.
# Do not edit this file manually.

version: 2
checksum: bd05cf1a8cadb5c2486c0967a69d64e69e164fab40edb78d5d85e01875a9a8bd
dependencies:
- path: .juvix-build/stdlib/
dependencies: []
- git:
name: anoma_juvix-anoma-test
ref: f6a44eb714604bbaf923ebda31cdf4e7862d0186
url: https://github.com/anoma/juvix-anoma-test
dependencies:
- git:
name: anoma_juvix-anoma-stdlib
ref: 835ce837e75c35319ab7e362953f23f1bc5fd3e5
url: https://github.com/anoma/juvix-anoma-stdlib
dependencies:
- git:
name: anoma_juvix-stdlib
ref: 89a5960fb8a29291e9271986b98ca7b1edf4031b
url: https://github.com/anoma/juvix-stdlib
dependencies: []
- git:
name: anoma_juvix-stdlib
ref: 89a5960fb8a29291e9271986b98ca7b1edf4031b
url: https://github.com/anoma/juvix-stdlib
dependencies: []
- git:
name: anoma_juvix-containers
ref: c4c7af9bdf36aa9d2dbdc7e0372dd9278f60ff26
url: https://github.com/anoma/juvix-containers
dependencies:
- git:
name: anoma_juvix-stdlib
ref: 89a5960fb8a29291e9271986b98ca7b1edf4031b
url: https://github.com/anoma/juvix-stdlib
dependencies: []
- git:
name: anoma_juvix-test
ref: 4254b60351f283f31868498d4e238af8259243f8
url: https://github.com/anoma/juvix-test
dependencies:
- git:
name: anoma_juvix-stdlib
ref: 89a5960fb8a29291e9271986b98ca7b1edf4031b
url: https://github.com/anoma/juvix-stdlib
dependencies: []
- git:
name: anoma_juvix-test
ref: 4254b60351f283f31868498d4e238af8259243f8
url: https://github.com/anoma/juvix-test
dependencies:
- git:
name: anoma_juvix-stdlib
ref: 89a5960fb8a29291e9271986b98ca7b1edf4031b
url: https://github.com/anoma/juvix-stdlib
dependencies: []
- path: ../
dependencies:
- path: .juvix-build/stdlib/
dependencies: []
- git:
name: anoma_juvix-anoma-stdlib
ref: 835ce837e75c35319ab7e362953f23f1bc5fd3e5
url: https://github.com/anoma/juvix-anoma-stdlib
dependencies:
- git:
name: anoma_juvix-stdlib
ref: 89a5960fb8a29291e9271986b98ca7b1edf4031b
url: https://github.com/anoma/juvix-stdlib
dependencies: []
9 changes: 9 additions & 0 deletions tests/Main.juvix
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module Main;

import Stdlib.Prelude open;
import SimpleCounterTests;
import Test.JuvixUnit open;

main : IO :=
runTestSuite
(testSuite "SimpleCounter tests" SimpleCounterTests.tests);
12 changes: 12 additions & 0 deletions tests/Package.juvix
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module Package;

import PackageDescription.V2 open;

package : Package :=
defaultPackage {
name := "anoma-apps-tests";
dependencies := [
defaultStdlib
; github "anoma" "juvix-test" "v0.11.0"
; path "../SimpleCounter/tests"]
};
86 changes: 86 additions & 0 deletions tests/juvix.lock.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# This file was autogenerated by Juvix version 0.6.3.
# Do not edit this file manually.

version: 2
checksum: d87fd331b8995c3c7132891e739e8ee59e768b9ba40d84de6c9fdf43e43fd33d
dependencies:
- path: .juvix-build/stdlib/
dependencies: []
- git:
name: anoma_juvix-test
ref: 4254b60351f283f31868498d4e238af8259243f8
url: https://github.com/anoma/juvix-test
dependencies:
- git:
name: anoma_juvix-stdlib
ref: 89a5960fb8a29291e9271986b98ca7b1edf4031b
url: https://github.com/anoma/juvix-stdlib
dependencies: []
- path: ../SimpleCounter/tests
dependencies:
- path: .juvix-build/stdlib/
dependencies: []
- git:
name: anoma_juvix-anoma-test
ref: f6a44eb714604bbaf923ebda31cdf4e7862d0186
url: https://github.com/anoma/juvix-anoma-test
dependencies:
- git:
name: anoma_juvix-anoma-stdlib
ref: 835ce837e75c35319ab7e362953f23f1bc5fd3e5
url: https://github.com/anoma/juvix-anoma-stdlib
dependencies:
- git:
name: anoma_juvix-stdlib
ref: 89a5960fb8a29291e9271986b98ca7b1edf4031b
url: https://github.com/anoma/juvix-stdlib
dependencies: []
- git:
name: anoma_juvix-stdlib
ref: 89a5960fb8a29291e9271986b98ca7b1edf4031b
url: https://github.com/anoma/juvix-stdlib
dependencies: []
- git:
name: anoma_juvix-containers
ref: c4c7af9bdf36aa9d2dbdc7e0372dd9278f60ff26
url: https://github.com/anoma/juvix-containers
dependencies:
- git:
name: anoma_juvix-stdlib
ref: 89a5960fb8a29291e9271986b98ca7b1edf4031b
url: https://github.com/anoma/juvix-stdlib
dependencies: []
- git:
name: anoma_juvix-test
ref: 4254b60351f283f31868498d4e238af8259243f8
url: https://github.com/anoma/juvix-test
dependencies:
- git:
name: anoma_juvix-stdlib
ref: 89a5960fb8a29291e9271986b98ca7b1edf4031b
url: https://github.com/anoma/juvix-stdlib
dependencies: []
- git:
name: anoma_juvix-test
ref: 4254b60351f283f31868498d4e238af8259243f8
url: https://github.com/anoma/juvix-test
dependencies:
- git:
name: anoma_juvix-stdlib
ref: 89a5960fb8a29291e9271986b98ca7b1edf4031b
url: https://github.com/anoma/juvix-stdlib
dependencies: []
- path: ../
dependencies:
- path: .juvix-build/stdlib/
dependencies: []
- git:
name: anoma_juvix-anoma-stdlib
ref: 835ce837e75c35319ab7e362953f23f1bc5fd3e5
url: https://github.com/anoma/juvix-anoma-stdlib
dependencies:
- git:
name: anoma_juvix-stdlib
ref: 89a5960fb8a29291e9271986b98ca7b1edf4031b
url: https://github.com/anoma/juvix-stdlib
dependencies: []

0 comments on commit a4f04aa

Please sign in to comment.