forked from GenXProject/GenX.jl
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature-tests' into develop
- Loading branch information
Showing
15 changed files
with
121 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,10 +14,10 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
version: | ||
- "1.6" | ||
- "1.6" # LTS (64-bit Linux) | ||
- "1.7" | ||
- "1.8" | ||
- '1' # latest stable 1.x Julia release (Linux) | ||
- '1' # latest stable 1.x Julia release (Linux) | ||
os: | ||
- ubuntu-latest | ||
arch: | ||
|
@@ -29,19 +29,19 @@ jobs: | |
allow_failure: true | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Create a new branch for test logs | ||
- name: Create a new branch and pull test logs from repo | ||
run: | | ||
if [[ ${{ matrix.version }} == '1' ]]; then | ||
git config --local user.name lbonaldo | ||
git config --local user.email "[email protected]" | ||
git checkout -b ${GITHUB_REF#refs/heads/}-testlogs | ||
git ls-remote --exit-code --heads origin ${GITHUB_REF#refs/heads/}-testlogs | ||
if [ "$?" == "2" ] ; then # exit-code 2 if the branch doesn't exist | ||
echo "Branch doesn't exist. Skip fetching." | ||
else # if a branch exists, fetch it | ||
git fetch origin ${GITHUB_REF#refs/heads/}-testlogs | ||
git cherry-pick $(git log -n 1 origin/${GITHUB_REF#refs/heads/}-testlogs --pretty=format:"%H") | ||
fi | ||
git checkout -b ${GITHUB_REF#refs/heads/}-testlogs | ||
mkdir test/Logs; cd test/Logs | ||
git init | ||
git config --local user.name GenXProject | ||
git config --local user.email "[email protected]" | ||
git remote add testlog https://github.com/GenXProject/GenX-testlog.git | ||
git pull testlog main | ||
if [ -d Logs_v${{ matrix.version }} ]; then | ||
mv Logs_v${{ matrix.version }}/*.log . | ||
else | ||
mkdir Logs_v${{ matrix.version }} | ||
fi | ||
- uses: julia-actions/setup-julia@v1 | ||
with: | ||
|
@@ -50,13 +50,12 @@ jobs: | |
- uses: julia-actions/cache@v1 | ||
- uses: julia-actions/julia-buildpkg@v1 | ||
- uses: julia-actions/julia-runtest@v1 | ||
- name: Commit logs and push to repo # only for 1.x versions | ||
- name: Commit logs and push back to repo | ||
run: | | ||
if [[ ${{ matrix.version }} == '1' ]]; then | ||
git add -f test/Logs | ||
git commit -m "Update test logs" | ||
git push -f origin ${GITHUB_REF#refs/heads/}-testlogs | ||
fi | ||
mv *.log Logs_v${{ matrix.version }} | ||
git add -f Logs_v${{ matrix.version }} | ||
git commit -m "Update test logs for Julia v${{ matrix.version }}" | ||
git push testlog main | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- uses: julia-actions/julia-processcoverage@v1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
2023-10-11 02:37:37 | 6946.981912630803 ± 0.0001 | Test Passed | ||
Expression: ≈(obj_test, obj_true, atol = optimal_tol) | ||
Evaluated: ≈(6946.981912630803, 6946.9819126; atol = 0.0001) | ||
2023-10-11 03:01:00 | 6946.981912630803 ± 0.0001 | Test Passed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
2023-10-11 02:37:51 | Build and Run | Test Broken | ||
Expression: built | ||
2023-10-11 03:01:13 | Build and Run | Test Broken | ||
Expression: built |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
2023-10-11 02:38:03 | 79734.8003171703 ± 1.0e-5, 41630.03494225143 ± 1.0e-5, 27855.20631474678 ± 1.0e-5 | Test Passed | ||
Expression: all(obj_true .- optimal_tol .<= obj_test .<= obj_true .+ optimal_tol) | ||
2023-10-11 03:01:23 | 79734.80031717036 ± 1.0e-5, 41630.034942251485 ± 1.0e-5, 27855.206314746796 ± 1.0e-5 | Test Passed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
2023-10-11 02:36:57 | 2341.8230753008047 ± 1.0e-5 | Test Passed | ||
Expression: ≈(obj_test, obj_true, atol = optimal_tol) | ||
Evaluated: ≈(2341.8230753008047, 2341.8230753; atol = 1.0e-5) | ||
2023-10-11 03:00:24 | 2341.8230753008047 ± 1.0e-5 | Test Passed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
2023-10-11 02:37:34 | 92081.91504226513 ± 1.0e-5 | Test Passed | ||
Expression: ≈(obj_test, obj_true, atol = optimal_tol) | ||
Evaluated: ≈(92081.91504226513, 92081.915042; atol = 1.0e-5) | ||
2023-10-11 03:00:57 | 92081.91504226513 ± 1.0e-5 | Test Passed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
module TestUtilities | ||
|
||
using Test | ||
|
||
include(joinpath(@__DIR__, "utilities.jl")) | ||
|
||
@testset "get_exponent_sciform" begin | ||
@test get_exponent_sciform(0) == 0 | ||
@test get_exponent_sciform(0.005) == -3 | ||
@test get_exponent_sciform(0.0531) == -2 | ||
@test get_exponent_sciform(1) == 0 | ||
@test get_exponent_sciform(1.0000) == 0 | ||
@test get_exponent_sciform(1.0005) == 0 | ||
@test get_exponent_sciform(64.000) == 1 | ||
@test get_exponent_sciform(64.03) == 1 | ||
@test get_exponent_sciform(100) == 2 | ||
end | ||
|
||
@testset "round_objfromtol" begin | ||
@test round_objfromtol!(0, 0) == 0 | ||
@test round_objfromtol!(0.005, 1) == 0 | ||
@test round_objfromtol!(0.005, 0.1) == 0.0 | ||
@test round_objfromtol!(0.005, 0.01) == 0.0 | ||
@test round_objfromtol!(0.005, 0.001) == 0.005 | ||
@test round_objfromtol!(0.005, 0.0001) == 0.005 | ||
@test round_objfromtol!(1.005, 1) == 1 | ||
@test round_objfromtol!(1.005, 0.1) == 1.0 | ||
@test round_objfromtol!(1.005, 0.01) == 1.0 | ||
@test round_objfromtol!(1.005, 0.001) == 1.005 | ||
@test round_objfromtol!(2.006, 0.01) == 2.01 | ||
@test round_objfromtol!(10.65, 10) == 10 | ||
@test round_objfromtol!(10.65, 1) == 11 | ||
@test round_objfromtol!(10.65, 0.1) == 10.6 | ||
@test round_objfromtol!(10.65, 0.01) == 10.65 | ||
@test round_objfromtol!(10.65, 0.001) == 10.65 | ||
end | ||
|
||
|
||
end # module TestUtilities |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters