Skip to content

BenchmarkJob: Support running a specific branch of BaseBenchmarks.jl #153

@LilithHafner

Description

@LilithHafner

Nanosoldier's BenchmarkJob doesn't support such configuration. It would need to be added to the BenchmarkJob struct,

mutable struct BenchmarkJob <: AbstractJob
submission::JobSubmission # the original submission
tagpred::String # predicate string to be fed to @tagged
against::Union{BuildRef,Nothing} # the comparison build (if available)
date::Dates.Date # the date of the submitted job
isdaily::Bool # is the job a daily job?
skipbuild::Bool # use local julia install instead of a fresh build (for testing)
end
, add some parsing code to pick up an invocation flag,
function BenchmarkJob(submission::JobSubmission)
if haskey(submission.kwargs, :vs)
againststr = Meta.parse(submission.kwargs[:vs])
if in(SHA_SEPARATOR, againststr) # e.g. againststr == christopher-dG/julia@e83b7559df94b3050603847dbd6f3674058027e6
reporef, againstsha = split(againststr, SHA_SEPARATOR)
againstrepo = isempty(reporef) ? submission.config.trackrepo : reporef
againstbuild = commitref(submission.config, againstrepo, againstsha)
elseif in(BRANCH_SEPARATOR, againststr)
reporef, againstbranch = split(againststr, BRANCH_SEPARATOR)
againstrepo = isempty(reporef) ? submission.config.trackrepo : reporef
againstbuild = branchref(submission.config, againstrepo, againstbranch)
elseif in(TAG_SEPARATOR, againststr)
reporef, againsttag = split(againststr, TAG_SEPARATOR)
againstrepo = isempty(reporef) ? submission.config.trackrepo : reporef
againstbuild = tagref(submission.config, againstrepo, againsttag)
elseif againststr == SPECIAL_SELF
againstbuild = copy(submission.build)
else
error("invalid argument to `vs` keyword")
end
against = againstbuild
elseif submission.prnumber !== nothing
# if there is a PR number, we compare against the base branch
merge_base = GitHub.compare(submission.config.trackrepo,
"master", "refs/pull/$(submission.prnumber)/head";
auth=submission.config.auth).merge_base_commit
against = commitref(submission.config, submission.config.trackrepo, merge_base.sha)
else
against = nothing
end
if haskey(submission.kwargs, :skipbuild)
skipbuild = submission.kwargs[:skipbuild] == "true"
else
skipbuild = false
end
if haskey(submission.kwargs, :isdaily)
isdaily = submission.kwargs[:isdaily] == "true"
validatate_isdaily(submission)
else
isdaily = false
end
tagpred = if isempty(submission.args)
"ALL"
else
first(submission.args)
end
return BenchmarkJob(submission, tagpred, against,
Date(submission.build.time), isdaily, skipbuild)
end
, and use that option when checking out BaseBenchmarks, https://github.com/JuliaCI/Nanosoldier.jl/blob/master/src/jobs/BenchmarkJob.jl#L326-L349.

Originally posted by @maleadt in JuliaCI/BaseBenchmarks.jl#305 (comment)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions