Skip to content

Commit

Permalink
Fix broken tests and stop testing nightly (#224)
Browse files Browse the repository at this point in the history
  • Loading branch information
timholy committed Jul 21, 2023
1 parent 7637195 commit d68305f
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/UnitTest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
# https://github.com/actions/toolkit/issues/399
fail-fast: false
matrix:
julia-version: ['1.0', '1', 'nightly']
julia-version: ['1.0', '1.6', '1']
os: [ubuntu-latest, windows-latest, macOS-latest]
julia-arch: [x64]
# only test one 32-bit job
Expand All @@ -46,7 +46,7 @@ jobs:
env:
cache-name: cache-artifacts
with:
path: ~/.julia/artifacts
path: ~/.julia/artifacts
key: ${{ runner.os }}-test-${{ env.cache-name }}-${{ hashFiles('**/Project.toml') }}
restore-keys: |
${{ runner.os }}-test-${{ env.cache-name }}-
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
*.mem
docs/build
docs/site
Manifest.toml
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "AxisArrays"
uuid = "39de3d68-74b9-583c-8d2d-e117c070f3a9"
version = "0.4.6"
version = "0.4.7"

[deps]
Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Expand Down
22 changes: 19 additions & 3 deletions test/core.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
macro maybe_test_broken(brokenif, args...)
if VERSION < v"1"
return quote
@test_broken $(esc(args...))
end
else
return quote
if $(esc(brokenif))
@test_broken $(esc(args...))
else
@test $(esc(args...))
end
end
end
end

# FIXME: type stability broken. The following should NOT error
A = @inferred(AxisArray(reshape(1:24, 2,3,4), .1:.1:.2, .1:.1:.3, .1:.1:.4))
@test_throws ArgumentError AxisArray(reshape(1:24, 2,3,4), .1:.1:.1, .1:.1:.3, .1:.1:.4)
Expand Down Expand Up @@ -272,17 +288,17 @@ for C in arrays
local C
for op in functions # together, cover both reduced_indices and reduced_indices0
axv = axisvalues(C)
@test_broken @inferred(op(C; dims=1))
@maybe_test_broken (op === minimum) @inferred(op(C; dims=1)) isa AxisArray
C1 = op(C; dims=1)
@test typeof(C1) == typeof(C)
@test axisnames(C1) == (:y,:x)
@test axisvalues(C1) === (oftype(axv[1], Base.OneTo(1)), axv[2])
@test_broken @inferred(op(C, dims=2))
@maybe_test_broken (op === minimum) @inferred(op(C, dims=2)) isa AxisArray
C2 = op(C, dims=2)
@test typeof(C2) == typeof(C)
@test axisnames(C2) == (:y,:x)
@test axisvalues(C2) === (axv[1], oftype(axv[2], Base.OneTo(1)))
@test_broken @inferred(op(C, dims=(1,2)))
@maybe_test_broken (op === minimum) @inferred(op(C, dims=(1,2))) isa AxisArray
C12 = op(C, dims=(1,2))
@test typeof(C12) == typeof(C)
@test axisnames(C12) == (:y,:x)
Expand Down

2 comments on commit d68305f

@timholy
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/87970

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.4.7 -m "<description of version>" d68305fbbc5f15487c02f00d766927e49b189c0c
git push origin v0.4.7

Please sign in to comment.