Skip to content

Commit

Permalink
test on Julia 1.6 (#7)
Browse files Browse the repository at this point in the history
* add macos test as well
  • Loading branch information
simonbyrne authored Sep 29, 2022
1 parent 69abc69 commit 957063b
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 29 deletions.
34 changes: 30 additions & 4 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,55 @@ agents:
arch: x86_64

steps:
- label: ":linux:"
key: "linux"
- label: ":linux: latest"
key: "linux-latest"
plugins:
- JuliaCI/julia#v1:
version: "1"
- JuliaCI/julia-test#v1:
coverage: false
timeout_in_minutes: 60
timeout_in_minutes: 15
# Don't run Buildkite if the commit message includes the text [skip tests]
if: build.message !~ /\[skip tests\]/
agents:
os: linux

- wait

- label: ":linux: v1.6"
key: "linux-min"
plugins:
- JuliaCI/julia#v1:
version: "1.6"
- JuliaCI/julia-test#v1:
coverage: false
timeout_in_minutes: 15
# Don't run Buildkite if the commit message includes the text [skip tests]
if: build.message !~ /\[skip tests\]/
agents:
os: linux

- label: ":macos:"
key: "macos"
plugins:
- JuliaCI/julia#v1:
version: "1"
- JuliaCI/julia-test#v1:
coverage: false
timeout_in_minutes: 15
# Don't run Buildkite if the commit message includes the text [skip tests]
if: build.message !~ /\[skip tests\]/
agents:
os: macos

- label: ":windows:"
key: "windows"
plugins:
- JuliaCI/julia#v1:
version: "1"
- JuliaCI/julia-test#v1:
coverage: false
timeout_in_minutes: 60
timeout_in_minutes: 15
# Don't run Buildkite if the commit message includes the text [skip tests]
if: build.message !~ /\[skip tests\]/
agents:
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"

[compat]
Plots = "=1.33"
julia = "1.6"

[targets]
test = ["Test", "Plots"]
60 changes: 36 additions & 24 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,27 @@ step = ENV["BUILDKITE_STEP_KEY"]
@test success(`$(BuildkiteUtils.agent()) --version`)

@testset "meta-data" begin
if step == "linux"
if step == "linux-latest"
@test keys(BuildkiteUtils.METADATA) == []
elseif step == "windows"
@test keys(BuildkiteUtils.METADATA) == ["aa-linux"]
@test BuildkiteUtils.METADATA["aa-linux"] == "hello"
@test !haskey(BuildkiteUtils.METADATA, "test-linux-latest")
else
@test "test-linux-latest" in keys(BuildkiteUtils.METADATA)
@test haskey(BuildkiteUtils.METADATA, "test-linux-latest")
@test BuildkiteUtils.METADATA["test-linux-latest"] == "hello"
end

BuildkiteUtils.METADATA["aa-$step"] = "hello"
BuildkiteUtils.METADATA["test-$step"] = "hello"

if step == "linux"
@test keys(BuildkiteUtils.METADATA) == ["aa-linux"]
elseif step == "windows"
@test keys(BuildkiteUtils.METADATA) == ["aa-linux", "aa-windows"]
if step == "linux-latest"
@test keys(BuildkiteUtils.METADATA) == ["test-linux-latest"]
@test haskey(BuildkiteUtils.METADATA, "test-linux-latest")
else
@test haskey(BuildkiteUtils.METADATA, "test-linux-latest")
@test haskey(BuildkiteUtils.METADATA, "test-$step")
@test "test-$step" in keys(BuildkiteUtils.METADATA)
end
@test BuildkiteUtils.METADATA["aa-$step"] == "hello"

@test BuildkiteUtils.METADATA["test-$step"] == "hello"
end

using Plots
Expand All @@ -28,9 +34,9 @@ using Plots
dir = mktempdir()
subdir = joinpath(dir, "extra")
mkpath(subdir)
write(joinpath(subdir, "$step.txt"), "hello world")
write(joinpath(subdir, "step.txt"), step)

if step == "linux"
if step == "linux-latest"

@test BuildkiteUtils.artifact_search("*") == []

Expand All @@ -42,42 +48,48 @@ using Plots
BuildkiteUtils.artifact_upload("**/*.txt")
end

@test sort(BuildkiteUtils.artifact_search()) == sort(["sin x.png", "extra/linux.txt"])
@test sort(BuildkiteUtils.artifact_search()) == sort(["sin x.png", "extra/step.txt"])

newdir = mktempdir()
BuildkiteUtils.artifact_download("*.png", newdir; step=step)
@test readdir(newdir) == ["sin x.png"]
@test read(joinpath(dir, "sin x.png")) == read(joinpath(newdir, "sin x.png"))

elseif step == "windows"
else

@test sort(BuildkiteUtils.artifact_search()) == sort(["sin x.png", "extra/linux.txt"])
@test sort(BuildkiteUtils.artifact_search(step="linux-latest")) == sort(["sin x.png", "extra/step.txt"])
@test isempty(BuildkiteUtils.artifact_search(step=step))

cd(dir) do
BuildkiteUtils.artifact_upload("**/*.txt")
end

@test sort(BuildkiteUtils.artifact_search()) == sort(["sin x.png", "extra/linux.txt", "extra\\windows.txt"])
@test sort(BuildkiteUtils.artifact_search(; step="linux")) == sort(["sin x.png", "extra/linux.txt"])
@test sort(BuildkiteUtils.artifact_search(; step="windows")) == sort(["extra\\windows.txt"])
if step == "windows"
@test BuildkiteUtils.artifact_search(step=step) == ["extra\\step.txt"]
else
@test BuildkiteUtils.artifact_search(step=step) == ["extra/step.txt"]
end

newdir = mktempdir()
BuildkiteUtils.artifact_download("*.png", newdir; step="linux")
BuildkiteUtils.artifact_download("*.png", newdir; step="linux-latest")
@test readdir(newdir) == ["sin x.png"]
end
end

@testset "annotation" begin
if step == "linux"
BuildkiteUtils.annotate("Hello from :linux:\n")
if step == "linux-latest"
BuildkiteUtils.annotate("Hello from :linux:\n\n")
BuildkiteUtils.annotate("""
Success
Success!
<img src="artifact://sin x.png" alt="sin(x)" height=250 >
"""; style="success", context="xtra")

elseif step == "linux-v1.6"
BuildkiteUtils.annotate("and from :linux: v1.6\n\n"; append=true)
elseif step == "windows"
BuildkiteUtils.annotate("and from :windows:\n"; append=true)

BuildkiteUtils.annotate("and from :windows:\n\n"; append=true)
elseif step == "macos"
BuildkiteUtils.annotate("and from :macos:\n\n"; append=true)
end
end

2 comments on commit 957063b

@simonbyrne
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 updated: JuliaRegistries/General/69185

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.1.0 -m "<description of version>" 957063bff56033eb08453e00a6efb748b5d274c9
git push origin v0.1.0

Please sign in to comment.