Skip to content

Commit

Permalink
Set ptest retries to 1 for PR package build check. (CP: #10133) (#10219)
Browse files Browse the repository at this point in the history
  • Loading branch information
PawelWMS authored Sep 4, 2024
1 parent e286e15 commit 1449e91
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .pipelines/prchecks/PackageBuildPRCheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -102,15 +102,16 @@ extends:
steps:
- template: .pipelines/templates/PackageBuild.yml@self
parameters:
checkBuildRetries: "1"
customToolchainArtifactName: $(toolchainArtifactNameBase)_${{ configuration.name }}
isCheckBuild: true
isQuickRebuildPackages: true
outputArtifactsFolder: $(ob_outputDirectory)
maxCPU: "${{ configuration.maxCPUs }}"
pipArtifactFeeds: "mariner/Mariner-Pypi-Feed"
selfRepoName: self
testSuiteName: "[${{ configuration.name }}] Package test"
testRerunList: "$(testListFromToolchain)"
testSuiteName: "[${{ configuration.name }}] Package test"

- task: PublishPipelineArtifact@1
inputs:
Expand Down
17 changes: 13 additions & 4 deletions .pipelines/templates/PackageBuild.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ parameters:
type: string
default: "$(Build.SourcesDirectory)"

- name: checkBuildRetries
type: string
default: ""

- name: concurrentPackageBuilds
type: number
default: 12
Expand All @@ -22,10 +26,6 @@ parameters:
type: string
default: ""

- name: testRerunList
type: string
default: ""

- name: failOnTestFailures
type: boolean
default: true
Expand Down Expand Up @@ -125,6 +125,10 @@ parameters:
type: string
default: ""

- name: testRerunList
type: string
default: ""

- name: testSuiteName
type: string
default: "Package test"
Expand Down Expand Up @@ -176,6 +180,10 @@ steps:
displayName: "Populate cache RPMs"
- script: |
if [[ -n "${{ parameters.checkBuildRetries }}" ]]; then
check_build_retries_arg="CHECK_BUILD_RETRIES=${{ parameters.checkBuildRetries }}"
fi
if [[ ${{ parameters.isDeltaBuild }} == "true" ]]; then
delta_fetch_arg="DELTA_FETCH=y"
elif [[ ${{ parameters.isDeltaBuild }} == "false" ]]; then
Expand Down Expand Up @@ -217,6 +225,7 @@ steps:
SPECS_DIR="${{ parameters.buildRepoRoot }}/${{ parameters.specsFolderPath }}" \
SRPM_PACK_LIST="${{ parameters.srpmPackList }}" \
TEST_RERUN_LIST="${{ parameters.testRerunList }}" \
$check_build_retries_arg \
$delta_fetch_arg \
$max_cascading_rebuilds_arg \
$quick_rebuild_packages_arg \
Expand Down
4 changes: 2 additions & 2 deletions toolkit/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ PACKAGE_CACHE_SUMMARY ?=
IMAGE_CACHE_SUMMARY ?=
INITRD_CACHE_SUMMARY ?=
PACKAGE_ARCHIVE ?=
PACKAGE_BUILD_RETRIES ?= 1
CHECK_BUILD_RETRIES ?= 1
PACKAGE_BUILD_RETRIES ?= 0
CHECK_BUILD_RETRIES ?= 0
EXTRA_BUILD_LAYERS ?= 0
REFRESH_WORKER_CHROOT ?= y
# Set to 0 to use the number of logical CPUs.
Expand Down
4 changes: 2 additions & 2 deletions toolkit/scripts/pkggen.mk
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,8 @@ $(STATUS_FLAGS_DIR)/build-rpms.flag: $(no_repo_acl) $(preprocessed_file) $(chroo
--distro-release-version="$(RELEASE_VERSION)" \
--distro-build-number="$(BUILD_NUMBER)" \
--rpmmacros-file="$(TOOLCHAIN_MANIFESTS_DIR)/macros.override" \
--build-attempts="$(PACKAGE_BUILD_RETRIES)" \
--check-attempts="$(CHECK_BUILD_RETRIES)" \
--build-attempts="$$(($(PACKAGE_BUILD_RETRIES)+1))" \
--check-attempts="$$(($(CHECK_BUILD_RETRIES)+1))" \
$(if $(MAX_CASCADING_REBUILDS),--max-cascading-rebuilds="$(MAX_CASCADING_REBUILDS)") \
--extra-layers="$(EXTRA_BUILD_LAYERS)" \
--build-agent="chroot-agent" \
Expand Down
2 changes: 1 addition & 1 deletion toolkit/tools/scheduler/schedulerutils/buildworker.go
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ func testSRPMFile(agent buildagents.BuildAgent, checkAttempts int, basePackageNa
}, checkAttempts, retryDuration)

if checkFailed {
logger.Log.Debugf("Tests failed for '%s' after %d retries.", basePackageName, checkAttempts)
logger.Log.Debugf("Tests failed for '%s' after %d attempt(s).", basePackageName, checkAttempts)
err = nil
}
return
Expand Down

0 comments on commit 1449e91

Please sign in to comment.