Skip to content

Commit

Permalink
restore tests
Browse files Browse the repository at this point in the history
  • Loading branch information
janmasrovira committed Oct 31, 2024
1 parent 6cecd9d commit 34275a5
Show file tree
Hide file tree
Showing 3 changed files with 174 additions and 184 deletions.
144 changes: 72 additions & 72 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,41 +75,41 @@ jobs:
build-and-test-linux:
runs-on: ubuntu-22.04
steps:
# - name: Free disk space
# run: |
# df -h
# echo "/usr/local"
# du -hsc /usr/local/*
# sudo rm -rf \
# /usr/local/aws-sam-cil \
# /usr/local/julia* || :
# echo "end /usr/local"
# echo "/usr/local/lib"
# du -hsc /usr/local/lib/*
# sudo rm -rf \
# /usr/local/lib/android \
# /usr/local/lib/heroku \
# /usr/local/lib/node_modules || :
# echo "end /usr/local/lib"
# echo "/usr/local/share"
# du -hsc /usr/local/share/*
# sudo rm -rf \
# /usr/local/share/chromium \
# /usr/local/share/powershell || :
# echo "end /usr/local/share"
# echo "/opt/hostedtoolcache/"
# du -hsc /opt/hostedtoolcache/*
# sudo rm -rf \
# /opt/hostedtoolcache/CodeQL \
# /opt/hostedtoolcache/go \
# /opt/hostedtoolcache/PyPy \
# /opt/hostedtoolcache/node || :
# echo "end /opt/hostedtoolcache/*"
# sudo apt purge -y \
# firefox \
# google-chrome-stable \
# microsoft-edge-stable
# df -h
- name: Free disk space
run: |
df -h
echo "/usr/local"
du -hsc /usr/local/*
sudo rm -rf \
/usr/local/aws-sam-cil \
/usr/local/julia* || :
echo "end /usr/local"
echo "/usr/local/lib"
du -hsc /usr/local/lib/*
sudo rm -rf \
/usr/local/lib/android \
/usr/local/lib/heroku \
/usr/local/lib/node_modules || :
echo "end /usr/local/lib"
echo "/usr/local/share"
du -hsc /usr/local/share/*
sudo rm -rf \
/usr/local/share/chromium \
/usr/local/share/powershell || :
echo "end /usr/local/share"
echo "/opt/hostedtoolcache/"
du -hsc /opt/hostedtoolcache/*
sudo rm -rf \
/opt/hostedtoolcache/CodeQL \
/opt/hostedtoolcache/go \
/opt/hostedtoolcache/PyPy \
/opt/hostedtoolcache/node || :
echo "end /opt/hostedtoolcache/*"
sudo apt purge -y \
firefox \
google-chrome-stable \
microsoft-edge-stable
df -h
- uses: extractions/setup-just@v2

Expand Down Expand Up @@ -213,49 +213,49 @@ jobs:
path: ${{ env.HOME }}/.local/bin/juvix-cairo-vm
key: ${{ runner.os }}-cairo-vm-${{ env.CAIRO_VM_VERSION }}

# - name: Install Rust toolchain
# if: steps.cache-cairo-vm.outputs.cache-hit != 'true'
# uses: actions-rust-lang/setup-rust-toolchain@v1
# with:
# cache-on-failure: false

# - name: Install RISC0 VM
# shell: bash
# run: |
# cargo install cargo-binstall@1.6.9 --force
# cargo binstall cargo-risczero@1.1.1 --no-confirm --force
# cargo risczero install

# - name: Checkout CairoVM
# uses: actions/checkout@v4
# if: steps.cache-cairo-vm.outputs.cache-hit != 'true'
# with:
# repository: anoma/juvix-cairo-vm
# path: juvix-cairo-vm
# ref: ${{ env.CAIRO_VM_VERSION }}

# - name: Install Cairo VM
# if: steps.cache-cairo-vm.outputs.cache-hit != 'true'
# shell: bash
# run: |
# cd juvix-cairo-vm
# cargo build --release
# cp target/release/juvix-cairo-vm $HOME/.local/bin/juvix-cairo-vm

# - name: Install run_cairo_vm.sh
# shell: bash
# run: |
# cp main/scripts/run_cairo_vm.sh $HOME/.local/bin/run_cairo_vm.sh
- name: Install Rust toolchain
if: steps.cache-cairo-vm.outputs.cache-hit != 'true'
uses: actions-rust-lang/setup-rust-toolchain@v1
with:
cache-on-failure: false

- name: Install RISC0 VM
shell: bash
run: |
cargo install cargo-binstall@1.6.9 --force
cargo binstall cargo-risczero@1.1.1 --no-confirm --force
cargo risczero install
- name: Checkout CairoVM
uses: actions/checkout@v4
if: steps.cache-cairo-vm.outputs.cache-hit != 'true'
with:
repository: anoma/juvix-cairo-vm
path: juvix-cairo-vm
ref: ${{ env.CAIRO_VM_VERSION }}

- name: Install Cairo VM
if: steps.cache-cairo-vm.outputs.cache-hit != 'true'
shell: bash
run: |
cd juvix-cairo-vm
cargo build --release
cp target/release/juvix-cairo-vm $HOME/.local/bin/juvix-cairo-vm
- name: Install run_cairo_vm.sh
shell: bash
run: |
cp main/scripts/run_cairo_vm.sh $HOME/.local/bin/run_cairo_vm.sh
- name: Make runtime
run: |
cd main
just ${{ env.JUST_ARGS }} build runtime
# - name: Test Rust runtime
# run: |
# cd main/runtime/rust/juvix
# cargo test --release
- name: Test Rust runtime
run: |
cd main/runtime/rust/juvix
cargo test --release
# We use the options:
# - -fhide-source-paths
Expand Down
86 changes: 40 additions & 46 deletions test/Anoma/Compilation/Positive.hs
Original file line number Diff line number Diff line change
Expand Up @@ -140,54 +140,48 @@ checkOutput expected = case unsnoc expected of
anomaNodeValid :: IntSet
anomaNodeValid =
intSet
[ 1
[ 1,
2,
5,
8,
10,
16,
17,
18,
19,
24,
26,
31,
36,
37,
38,
40,
41,
45,
46,
47,
50,
52,
53,
54,
55,
56,
57,
58,
59,
60,
62,
64,
65,
66,
67,
68,
69,
70,
71,
72
]

-- anomaNodeValid :: IntSet
-- anomaNodeValid =
-- intSet
-- [ 1,
-- 2,
-- 5,
-- 8,
-- 10,
-- 16,
-- 17,
-- 18,
-- 19,
-- 24,
-- 26,
-- 31,
-- 36,
-- 37,
-- 38,
-- 40,
-- 41,
-- 45,
-- 46,
-- 47,
-- 50,
-- 52,
-- 53,
-- 54,
-- 55,
-- 56,
-- 57,
-- 58,
-- 59,
-- 60,
-- 62,
-- 64,
-- 65,
-- 66,
-- 67,
-- 68,
-- 69,
-- 70,
-- 71,
-- 72
-- ]

anomaNodeBug :: IntSet
anomaNodeBug =
intSet
Expand Down
128 changes: 62 additions & 66 deletions test/Main.hs
Original file line number Diff line number Diff line change
@@ -1,74 +1,70 @@
module Main (main) where

-- import Anoma qualified
-- import Asm qualified
-- import BackendMarkdown qualified

import Anoma.Compilation.Positive qualified as AnomaPositive
import Anoma qualified
import Asm qualified
import BackendMarkdown qualified
import Base
import Casm qualified
import Compilation qualified
import Core qualified
import Examples qualified
import Format qualified
import Formatter qualified
import Internal qualified
import Isabelle qualified
import Juvix.Config qualified as Config
import Nockma qualified
import Package qualified
import Parsing qualified
import Reg qualified
import Repl qualified
import Resolver qualified
import Runtime qualified
import Rust qualified
import Scope qualified
import Termination qualified
import Tree qualified
import Typecheck qualified

-- import Casm qualified
-- import Compilation qualified
-- import Core qualified
-- import Examples qualified
-- import Format qualified
-- import Formatter qualified
-- import Internal qualified
-- import Isabelle qualified
-- import Juvix.Config qualified as Config
-- import Nockma qualified
-- import Package qualified
-- import Parsing qualified
-- import Reg qualified
-- import Repl qualified
-- import Resolver qualified
-- import Runtime qualified
-- import Rust qualified
-- import Scope qualified
-- import Termination qualified
-- import Tree qualified
-- import Typecheck qualified

-- slowTests :: IO TestTree
-- slowTests =
-- sequentialTestGroup
-- "Juvix slow tests"
-- AllFinish
-- <$> sequence
-- [ return Runtime.allTests,
-- return Reg.allTests,
-- return Asm.allTests,
-- return Tree.allTests,
-- return Core.allTests,
-- return Internal.allTests,
-- return Compilation.allTests,
-- return Examples.allTests,
-- Casm.allTests,
-- return Anoma.allTests,
-- return Repl.allTests
-- ]
-- <> sequence (if Config.config ^. Config.configRust then [Rust.allTests] else [])
slowTests :: IO TestTree
slowTests =
sequentialTestGroup
"Juvix slow tests"
AllFinish
<$> sequence
[ return Runtime.allTests,
return Reg.allTests,
return Asm.allTests,
return Tree.allTests,
return Core.allTests,
return Internal.allTests,
return Compilation.allTests,
return Examples.allTests,
Casm.allTests,
return Anoma.allTests,
return Repl.allTests
]
<> sequence (if Config.config ^. Config.configRust then [Rust.allTests] else [])

-- fastTests :: IO TestTree
-- fastTests =
-- return $
-- testGroup
-- "Juvix fast tests"
-- [ Parsing.allTests,
-- Resolver.allTests,
-- Scope.allTests,
-- Termination.allTests,
-- Typecheck.allTests,
-- Format.allTests,
-- Formatter.allTests,
-- Package.allTests,
-- BackendMarkdown.allTests,
-- Isabelle.allTests,
-- Nockma.allTests
-- ]
fastTests :: IO TestTree
fastTests =
return $
testGroup
"Juvix fast tests"
[ Parsing.allTests,
Resolver.allTests,
Scope.allTests,
Termination.allTests,
Typecheck.allTests,
Format.allTests,
Formatter.allTests,
Package.allTests,
BackendMarkdown.allTests,
Isabelle.allTests,
Nockma.allTests
]

main :: IO ()
main = do
-- tests <- sequence [fastTests, slowTests]
-- defaultMain (testGroup "Juvix tests" tests)
defaultMain AnomaPositive.allTests
tests <- sequence [fastTests, slowTests]
defaultMain (testGroup "Juvix tests" tests)

0 comments on commit 34275a5

Please sign in to comment.