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

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

Open
LilithHafner opened this issue Jan 3, 2023 · 0 comments
Open

Comments

@LilithHafner
Copy link
Contributor

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)

@maleadt maleadt changed the title Tell nanosoldier to use an alternate branch of BaseBenchmarks.jl BenchmarkJob: Support running a specific branch of BaseBenchmarks.jl Jan 3, 2023
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

No branches or pull requests

1 participant