Open makortel opened 4 years ago
assign core
New categories assigned: core
@Dr15Jones,@smuzaffar,@makortel you have been requested to review this Pull request/Issue and eventually sign? Thanks
A new Issue was created by @makortel Matti Kortelainen.
@Dr15Jones, @silviodonato, @dpiparo, @smuzaffar, @makortel can you please review it and eventually sign/assign? Thanks.
cms-bot commands are listed here
@smuzaffar The template scripts heavily assume being run in $CMSSW_BASE/src/Package
. What would be the best way to craft a script testing these scripts? I'm thinking questions like
mkdir $CMSSW_BASE/src/SkeletonTestPackage
in the script)? But what to do in absence of developer area?clang-format
and clang-tidy
. Are those feasible from scripts run by scram b runtests
?scram b runtests
? (similar to addOnTests.py
)(spurred by https://mattermost.web.cern.ch/cms-o-and-c/pl/kgpdtbtdzfyi8ezs9brdqf7awc)
@makortel I would suggest to do something like the following in the testing script
#!/bin/bash -ex
#Create a new CMSSW dev area
OLD_CMSSW_BASE=$CMSSW_BASE
rm -rf $SCRAM_TEST_NAME
mkdir $SCRAM_TEST_NAME
cd $SCRAM_TEST_NAME
scram -a $SCRAM_ARCH project $CMSSW_VERSION
cd $CMSSW_VERSION/src
eval `scram run -sh`
git cms-init
#Copy FWCore/Skeletons in cause unit test is run during PR tests which contains changes for FWCore/Skeletons
if [ -d $OLD_CMSSW_BASE/src/FWCore/Skeletons ] ; then
mkdir FWCore
cp -r $OLD_CMSSW_BASE/src/FWCore/Skeletons FWCore/Skeletons
scram build
fi
#Create Test Subsystem for testing the mkedanlzr
mkdir Test
pushd Test
mkedanlzr Analyzer
mkedanlzr Producer
popd
git add Test
git commit -a -m 'Added Test/Analyzer'
scram b code-checks-all
scram b code-format-all
git diff
if [ $(git diff --name-only | grep Test/Analyzer |wc -l) -gt 0 ] ; then
exit 1
fi
scram build
Thanks @smuzaffar! I followed your suggestion in https://github.com/cms-sw/cmssw/pull/37125, and at least in local tests it seems to work fine.
Some follow-up items from #29840
clang-format
andclang-tidy
to ensure the generated skeletons comply with code checksAnd to not forget, https://github.com/cms-sw/cmssw/issues/26618 has also a few items left.