Skip to content

Commit

Permalink
Add CLI tests (#366)
Browse files Browse the repository at this point in the history
* Add CLI tests

- Add CLI tests
- Track Manifest files
- Move downloading test data to own file
- Add pixi tasks

* Initialize Julia

* Fix precompile

* Add juliaup to dependencies

* Finalize juliaup installation

* Add pixi task for testing julia

* Fix copy-paste mistakes

* add more tests

* Update .gitignore

* add timing tests

* revert gitingnore changes; add WflowServer Manifest

* switch WflowServer tests to pixi; included changes in CI

* remove julia v1.6 testing for WflowServer

* fix Manifest files to julia 1.10.0

* update timing test values

* set environment variable locally

* update link in README.md

* test if test fails

* test if wflow test fails

* revert wflow test fail

* revert breaking test

* test force-adding wflow through dev install

* improve bmi tests

---------

Co-authored-by: JoostBuitink <[email protected]>
  • Loading branch information
Hofer-Julian and JoostBuitink authored Mar 14, 2024
1 parent faba526 commit 105d99d
Show file tree
Hide file tree
Showing 21 changed files with 3,040 additions and 108 deletions.
3 changes: 3 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# GitHub syntax highlighting
pixi.lock linguist-language=YAML

29 changes: 11 additions & 18 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,11 @@ on:
tags: '*'
jobs:
test:
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ matrix.threads }} threads - ${{ github.event_name }}
name: Julia - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ matrix.threads }} threads - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- '1.6'
- '1'
os:
- ubuntu-latest
- windows-latest
Expand All @@ -25,22 +22,18 @@ jobs:
- '2'
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
- uses: julia-actions/cache@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: actions/cache@v4
env:
cache-name: cache-artifacts
cache-compiled: "true"
cache-registries: "true"
- uses: prefix-dev/[email protected]
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
pixi-version: "latest"
- name: Prepare pixi
run: pixi run install-julia
- name: Test Wflow
run: |
pixi run test-wflow-cov
env:
JULIA_NUM_THREADS: ${{ matrix.threads }}
- uses: julia-actions/julia-processcoverage@v1
Expand Down
36 changes: 10 additions & 26 deletions .github/workflows/CIWflowServer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,46 +7,30 @@ on:
tags: '*'
jobs:
test:
name: WflowServer Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
name: WflowServer Julia - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
version:
- '1.6'
- '1'
os:
- ubuntu-latest
- windows-latest
arch:
- x64
steps:
- uses: actions/checkout@v4
- uses: julia-actions/setup-julia@v1
- uses: julia-actions/cache@v1
with:
version: ${{ matrix.version }}
arch: ${{ matrix.arch }}
- uses: actions/cache@v4
env:
cache-name: cache-artifacts
cache-compiled: "true"
cache-registries: "true"
- uses: prefix-dev/[email protected]
with:
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
${{ runner.os }}-test-
${{ runner.os }}-
- name: Install Julia dependencies
shell: julia --project=server {0}
pixi-version: "latest"
- name: Prepare pixi
run: pixi run install-julia
- name: Test WflowServer
run: |
using Pkg;
# dev install Wflow
pkg"dev ."
- name: Run the Wflow Server tests
continue-on-error: true
run: >
julia --color=yes --project=server -e 'using Pkg; Pkg.test("WflowServer", coverage=true)'
shell: bash
pixi run test-wflow-server
- uses: julia-actions/julia-processcoverage@v1
with:
directories: server/src
Expand Down
11 changes: 8 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
# VS Code stuff
.vscode

# Manifest toml from project toml
**/Manifest.toml

# Packaging stuff
*.jl.*.cov
*.jl.cov
Expand All @@ -24,3 +21,11 @@

# Build files
/build/create_binaries/wflow_bundle/

# Server test files
/server/test/data/

# pixi environments
.pixi
# juliaup
utils/juliaup
Loading

0 comments on commit 105d99d

Please sign in to comment.