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

ci: fix warnings with wildcards and archive system-tests #18695

Merged
merged 28 commits into from
Jul 20, 2020
Merged
Show file tree
Hide file tree
Changes from 19 commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
9f725c1
ci: fix warnings with wildcards
v1v May 21, 2020
ecceee2
ci: use make as a wrapper and python as the implementation
v1v May 27, 2020
a9c95d9
ci: support windows
v1v May 27, 2020
3f2c1bc
fix: autopep8 lint
v1v May 27, 2020
809b906
fix symlinks, permissions and use python instead make
v1v May 28, 2020
b66aa23
more verbose, skip some folders that causes issues in windows
v1v May 28, 2020
660ddd1
Support multiplatform and overriide copy_tree to filter problematic f…
v1v May 29, 2020
594eb00
platform agnostic
v1v May 29, 2020
f5c4ad8
comment to support system-tests
v1v May 29, 2020
57541c3
prepare context to filter what to archive
v1v May 29, 2020
dc124f5
refactor and support system-tests search for Linux
v1v May 29, 2020
714c8ed
Support system-tests archiving in windows
v1v May 29, 2020
324870c
fix: script path
v1v May 29, 2020
8605d36
Force where to look for
v1v May 29, 2020
7de9a9c
Update .ci/scripts/pre_archive_test.py
v1v Jun 2, 2020
8b737da
ci: use cmd step
v1v Jun 2, 2020
5150beb
ci: rephrase a bit the docs
v1v Jun 2, 2020
b6606c4
Update Jenkinsfile
v1v Jun 3, 2020
ee7f570
fix: use hardcode paths
v1v Jun 3, 2020
fd04fee
Merge remote-tracking branch 'upstream/master' into feature/fix-warni…
v1v Jun 12, 2020
6557388
ci: cosmetic change in the log
v1v Jun 12, 2020
bd8d0d5
fix: the evil regex in groovy with backslashes
v1v Jun 12, 2020
626840d
Revert "fix: use hardcode paths"
v1v Jun 12, 2020
6af8dfb
Support OS in the name of the archived files
v1v Jun 12, 2020
1a069b1
Merge remote-tracking branch 'upstream/master' into feature/fix-warni…
v1v Jun 15, 2020
f7a03a6
ci: platform agnostic
v1v Jun 15, 2020
1838113
ci: fix the script approval for File.Separator
v1v Jun 15, 2020
cf807c2
Merge remote-tracking branch 'upstream/master' into feature/fix-warni…
v1v Jul 20, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .ci/scripts/pre_archive_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env python3

import os
import distutils
from distutils import dir_util
cachedout marked this conversation as resolved.
Show resolved Hide resolved


if __name__ == "__main__":

if not os.path.exists('build'):
os.makedirs('build')

# Top level folders to be excluded
EXCLUDE = set(['.ci', '.git', '.github', 'vendor', 'dev-tools'])
for root, dirs, files in os.walk('.'):
dirs[:] = [d for d in dirs if d not in EXCLUDE]
if root.endswith(('build')) and not root.startswith((".{}build".format(os.sep))):
dest = os.path.join('build', root.replace(".{}".format(os.sep), ''))
print("Copy {} into {}".format(root, dest))
distutils.dir_util.copy_tree(root, dest, preserve_symlinks=1)
10 changes: 10 additions & 0 deletions .ci/scripts/search_system_tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/usr/bin/env python3

import os


if __name__ == "__main__":

for root, dirs, files in os.walk('build'):
if root.endswith(('system-tests')):
print(root.replace("./", '').replace(".\\", ''))
35 changes: 27 additions & 8 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -847,17 +847,39 @@ def withBeatsEnv(boolean archive, Closure body) {
}
} finally {
if (archive) {
catchError(buildResult: 'SUCCESS', stageResult: 'UNSTABLE') {
junitAndStore(allowEmptyResults: true, keepLongStdio: true, testResults: "**/build/TEST*.xml")
archiveArtifacts(allowEmptyArchive: true, artifacts: '**/build/TEST*.out')
}
archiveTestOutput(testResults: '**/build/TEST*.xml', artifacts: '**/build/TEST*.out')
}
reportCoverage()
}
}
}
}

/**
This method archives and report the tests output, for such, it searches in certain folders
to bypass some issues when working with big repositories.
*/
def archiveTestOutput(Map args = [:]) {
catchError(buildResult: 'SUCCESS', stageResult: 'UNSTABLE') {
if (isUnix()) {
fixPermissions("${WORKSPACE}")
}
cmd(label: 'Prepare test output', script: 'python .ci/scripts/pre_archive_test.py')
dir('build') {
junitAndStore(allowEmptyResults: true, keepLongStdio: true, testResults: args.testResults)
archiveArtifacts(allowEmptyArchive: true, artifacts: args.artifacts)
}
catchError(buildResult: 'SUCCESS', message: 'Failed to archive the build test results', stageResult: 'SUCCESS') {
def folder = cmd(label: 'Find system-tests', returnStdout: true, script: 'python .ci/scripts/search_system_tests.py').trim()
log(level: 'INFO', text: "system-tests has been found in ${folder}")
if (folder.trim()) {
def name = folder.replaceAll('/', '-').replaceAll('\\', '-').replaceAll('build', '')
tar(file: "${name}.tgz", archive: true, dir: folder)
}
}
}
}

def withBeatsEnvWin(Closure body) {
final String chocoPath = 'C:\\ProgramData\\chocolatey\\bin'
final String chocoPython3Path = 'C:\\Python38;C:\\Python38\\Scripts'
Expand All @@ -881,10 +903,7 @@ def withBeatsEnvWin(Closure body) {
body()
}
} finally {
catchError(buildResult: 'SUCCESS', stageResult: 'UNSTABLE') {
junitAndStore(allowEmptyResults: true, keepLongStdio: true, testResults: "**\\build\\TEST*.xml")
archiveArtifacts(allowEmptyArchive: true, artifacts: '**\\build\\TEST*.out')
}
archiveTestOutput(testResults: "**\\build\\TEST*.xml", artifacts: "**\\build\\TEST*.out")
}
}
}
Expand Down