Skip to content

Commit 29b8fa9

Browse files
committed
test: fix runtests.jl to only check tutorial directories
- Filter out non-directory items (like files in scripts/) - Only check for index.jmd and Project.toml (not generated files) - Fixes test suite that was failing on both main and fix branches
1 parent 61b2485 commit 29b8fa9

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

test/runtests.jl

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,18 @@ function tests()
55
readdir(rootdir),
66
)
77
for dir in dirs
8-
subdirs = readdir(joinpath(rootdir, dir))
8+
subdirs = filter(y -> isdir(joinpath(rootdir, dir, y)), readdir(joinpath(rootdir, dir)))
99
for subdir in subdirs
10-
prefix = joinpath(rootdir, dir, subdir, subdir)
10+
prefix = joinpath(rootdir, dir, subdir, "index")
1111
println("Verifying files in $dir/$subdir")
12-
for suffix in [".jmd", ".html", ".ipynb", ".jl"]
13-
spc = " "^(6 - length(suffix))
14-
print(" $subdir$suffix$spc exists…… ")
15-
@assert isfile(prefix * suffix)
16-
println("")
17-
end
12+
# Only require the source markdown and Project.toml to be present
13+
print(" index.jmd exists…… ")
14+
@assert isfile(prefix * ".jmd")
15+
println("")
16+
17+
print(" Project.toml exists…… ")
18+
@assert isfile(joinpath(rootdir, dir, subdir, "Project.toml"))
19+
println("")
1820
end
1921
end
2022
end

0 commit comments

Comments
 (0)