Skip to content

Commit 70af117

Browse files
Update filter-packages-list.py so it can handle special ALL_PACKAGES (trilinos/Trilinos#3133)
I also updated the documentation a little. Now this should be ready to handle the output from get-tribits-packages-from-files-list.py which can contain ALL_PACKAGES and it should be ready to be used for the refactored Trilinos auto PR tester (trilinos/Trilinos#3133). Build/Test Cases Summary Enabled Packages: Enabled all Packages 0) MPI_DEBUG => passed: passed=268,notpassed=0 (0.72 min) 1) SERIAL_RELEASE => passed: passed=268,notpassed=0 (0.67 min) 2) MPI_DEBUG_CMAKE-3.6.2 => passed: passed=293,notpassed=0 (0.63 min) 3) SERIAL_RELEASE_CMAKE-3.6.2 => passed: passed=293,notpassed=0 (0.74 min) 4) MPI_DEBUG_CMAKE-3.11.1 => passed: passed=313,notpassed=0 (0.95 min) 5) SERIAL_RELEASE_CMAKE-3.11.1 => passed: passed=313,notpassed=0 (0.91 min) Other local commits for this build/test group: 7a97ef5, e22a629
1 parent 7a97ef5 commit 70af117

File tree

3 files changed

+45
-4
lines changed

3 files changed

+45
-4
lines changed

test/ci_support/TribitsPackageFilePathUtils_UnitTests.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,36 @@ def test_get_PT(self):
256256
)
257257

258258

259+
def test_get_PT_ALL_PACKAGES_begining(self):
260+
self.assertEqual(
261+
getCmndOutput(ciSupportDir+"/filter-packages-list.py" \
262+
" --deps-xml-file="+testingTrilinosDepsXmlInFile+"" \
263+
" --input-packages-list=ALL_PACKAGES,Teuchos,Thyra,Phalanx,Stokhos --keep-types=PT",
264+
True),
265+
b("ALL_PACKAGES,Teuchos,Thyra")
266+
)
267+
268+
269+
def test_get_PT_ALL_PACKAGES_end(self):
270+
self.assertEqual(
271+
getCmndOutput(ciSupportDir+"/filter-packages-list.py" \
272+
" --deps-xml-file="+testingTrilinosDepsXmlInFile+"" \
273+
" --input-packages-list=Teuchos,Thyra,Phalanx,Stokhos,ALL_PACKAGES --keep-types=PT",
274+
True),
275+
b("Teuchos,Thyra,ALL_PACKAGES")
276+
)
277+
278+
279+
def test_get_PT_ALL_PACKAGS_middle(self):
280+
self.assertEqual(
281+
getCmndOutput(ciSupportDir+"/filter-packages-list.py" \
282+
" --deps-xml-file="+testingTrilinosDepsXmlInFile+"" \
283+
" --input-packages-list=Teuchos,ALL_PACKAGES,Thyra,Phalanx,Stokhos --keep-types=PT",
284+
True),
285+
b("Teuchos,ALL_PACKAGES,Thyra")
286+
)
287+
288+
259289
def test_get_PT_ST(self):
260290
self.assertEqual(
261291
getCmndOutput(ciSupportDir+"/filter-packages-list.py" \

tribits/ci_support/TribitsDependencies.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,9 @@ def filterPackageNameList(self, inputPackagesList, keepTypesList, verbose=False)
295295
outputPackagesList = []
296296
for packageName in inputPackagesList:
297297
#print("packageName = " + packageName)
298+
if packageName == "ALL_PACKAGES":
299+
outputPackagesList.append(packageName)
300+
continue
298301
packageDep = self.getPackageByName(packageName)
299302
packageType = packageDep.packageType
300303
#print("packageType = " + packageType)

tribits/ci_support/filter-packages-list.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,15 @@
4646
# Read in the commandline arguments
4747
#
4848

49-
usageHelp = r"""filter-packages-list --input-packages-list=P1,P2,... --keep-types=T1,T2,...
49+
usageHelp = \
50+
r"""filter-packages-list --deps-xml-file=<PROJECT_DEPS_FILE> \
51+
--input-packages-list=<P1>,<P2>,... --keep-types=<T1>,<T2>,...
52+
53+
This script takes in a comma-seprated list of TriBITS package name
54+
<P1>,<P2>,... and keeps the package names matching the categories listed in
55+
<T1>,<T2>,... given the TriBITS-generated project dependencies file.
56+
57+
The comma-seprated filtered list of packages is printed to STDOUT.
5058
"""
5159

5260
from optparse import OptionParser
@@ -55,15 +63,15 @@
5563

5664
clp.add_option(
5765
"--input-packages-list", dest="inputPackagesList", type="string", default="",
58-
help="List of packages that needs to be filtered (i.e. \"P1,P2,...\")." )
66+
help="Comma-seprated List of packages that needs to be filtered (i.e. \"P1,P2,...\")." )
5967

6068
clp.add_option(
6169
"--keep-types", dest="keepTypes", type="string", default="",
62-
help="List of types to keep (i.e. \"PT,ST,EX\"." )
70+
help="List of package types to keep (i.e. \"PT,ST,EX\"." )
6371

6472
clp.add_option(
6573
"--deps-xml-file", dest="depsXmlFile", type="string",
66-
help="File containing the listing of packages, dir names, dependencies, etc.")
74+
help="TriBITS generated XML file containing the listing of packages, dir names, dependencies, etc.")
6775

6876
(options, args) = clp.parse_args()
6977

0 commit comments

Comments
 (0)