Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests on Julia nightly #863

Merged
merged 2 commits into from
Jun 21, 2023
Merged

Fix tests on Julia nightly #863

merged 2 commits into from
Jun 21, 2023

Conversation

ararslan
Copy link
Member

@ararslan ararslan commented May 3, 2023

The tests for specific exception types in sem are relying on the exceptions thrown from deeper in the call stack, outside of this package's control. We do still expect these cases to throw, but since we can't actually control the type of the exception, we can instead test that any exception is thrown.

The test of the number of allocations from calling mad on a generator fails because there are nearly 10x more allocations than the upper bound used in the test. We can mark this test broken with Julia v1.10, and the test will fail if the allocations for this case are improved, be it upstream or in the implementation of mad (if applicable).

The tests for specific exception types in `sem` are relying on the
exceptions thrown from deeper in the call stack, outside of this
package's control. We do still expect these cases to throw, but since we
can't actually control the type of the exception, we can instead test
that any exception is thrown.

The test of the number of allocations from calling `mad` on a generator
fails because there are nearly 10x more allocations than the upper bound
used in the test. We can mark this test broken with Julia v1.10, and the
test will fail if the allocations for this case are improved, be it
upstream or in the implementation of `mad` (if applicable).
Simply going from Documenter 0.24 to the latest, 0.27, fixes `makedocs`
for me locally. This should fix the documentation build on CI.
@ararslan
Copy link
Member Author

ararslan commented May 3, 2023

Error: 1 docstring not included in the manual:

    StatsBase.addcounts! :: Tuple{AbstractArray, AbstractArray{<:Integer}, UnitRange{<:Integer}}

These are docstrings in the checked modules (configured with the modules keyword)
that are not included in @docs or @autodocs blocks.

Populate: populating indices.
ERROR: LoadError: `makedocs` encountered an error (:missing_docs). Terminating build before rendering.

This is so weird. I can reproduce it locally only if there is an existing docs/build directory.

$ git clean -fdx
Removing Manifest.toml
Removing docs/Manifest.toml
Removing docs/build/
$ julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(; path=pwd())); Pkg.instantiate()'
[...]
$ julia --project=docs/ docs/make.jl
[ Info: SetupBuildDirectory: setting up build directory.
[ Info: Doctest: running doctests.
[ Info: ExpandTemplates: expanding markdown templates.
[ Info: CrossReferences: building cross-references.
[ Info: CheckDocument: running document checks.
[ Info: Populate: populating indices.
[ Info: RenderDocument: rendering document.
[ Info: HTMLWriter: rendering HTML pages.
$ julia --project=docs/ docs/make.jl
[ Info: SetupBuildDirectory: setting up build directory.
[ Info: Doctest: running doctests.
[ Info: ExpandTemplates: expanding markdown templates.
[ Info: CrossReferences: building cross-references.
[ Info: CheckDocument: running document checks.
┌ Error: 1 docstring not included in the manual:
│
│     StatsBase.addcounts! :: Tuple{AbstractArray, AbstractArray{<:Integer}, UnitRange{<:Integer}}
│
│ These are docstrings in the checked modules (configured with the modules keyword)
│ that are not included in @docs or @autodocs blocks.
└ @ Documenter.DocChecks ~/.julia/packages/Documenter/H5y27/src/Utilities/Utilities.jl:32
[ Info: Populate: populating indices.
ERROR: LoadError: `makedocs` encountered an error (:missing_docs). Terminating build before rendering.
Stacktrace:
 [1] error(s::String)
   @ Base ./error.jl:35
 [2] runner(#unused#::Type{Documenter.Builder.RenderDocument}, doc::Documenter.Documents.Document)
   @ Documenter.Builder ~/.julia/packages/Documenter/H5y27/src/Builder.jl:256
 [3] dispatch(#unused#::Type{Documenter.Builder.DocumentPipeline}, x::Documenter.Documents.Document)
   @ Documenter.Utilities.Selectors ~/.julia/packages/Documenter/H5y27/src/Utilities/Selectors.jl:170
 [4] #2
   @ ~/.julia/packages/Documenter/H5y27/src/Documenter.jl:273 [inlined]
 [5] cd(f::Documenter.var"#2#3"{Documenter.Documents.Document}, dir::String)
   @ Base.Filesystem ./file.jl:112
 [6] makedocs(; debug::Bool, format::Documenter.Writers.HTMLWriter.HTML, kwargs::Base.Pairs{Symbol, Any, NTuple{5, Symbol}, NamedTuple{(:sitename, :modules, :pages, :strict, :checkdocs), Tuple{String, Vector{Module}, Vector{String}, Bool, Symbol}}})
   @ Documenter ~/.julia/packages/Documenter/H5y27/src/Documenter.jl:272
 [7] top-level scope
   @ ~/Projects/julia-packages/StatsBase.jl/docs/make.jl:8
in expression starting at /Users/aarslan/Projects/julia-packages/StatsBase.jl/docs/make.jl:8

@devmotion
Copy link
Member

It seems the Documenter issue was fixed upstream (but is not available in 1.9 yet), so this shouldn't hold back the PR, should it?

@ararslan
Copy link
Member Author

It seems the Documenter issue was fixed upstream (but is not available in 1.9 yet)

It sounds like the upstream change that fixed the issue with Documenter will not go into 1.9 (JuliaLang/julia#49975 (comment)).

this shouldn't hold back the PR, should it?

Yeah I suppose not. I had forgotten about this PR but I believe at the time I figured I'd tackle CI issues together but the Documenter thing turned out to really be A Thing.

@ararslan ararslan merged commit dd0a987 into master Jun 21, 2023
@ararslan ararslan deleted the aa/fix-nightly-ci branch June 21, 2023 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants