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

Improve Skeleton templates and scripts #29850

Open
1 of 2 tasks
makortel opened this issue May 15, 2020 · 6 comments
Open
1 of 2 tasks

Improve Skeleton templates and scripts #29850

makortel opened this issue May 15, 2020 · 6 comments

Comments

@makortel
Copy link
Contributor

makortel commented May 15, 2020

Some follow-up items from #29840

  • Add an example on ESProduct consumes in ESProducers
  • Add tests, done in Add tests for Skeleton templates #37125
    • Tests should preferably include clang-format and clang-tidy to ensure the generated skeletons comply with code checks

And to not forget, #26618 has also a few items left.

@makortel
Copy link
Contributor Author

assign core

@cmsbuild
Copy link
Contributor

New categories assigned: core

@Dr15Jones,@smuzaffar,@makortel you have been requested to review this Pull request/Issue and eventually sign? Thanks

@cmsbuild
Copy link
Contributor

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

@makortel
Copy link
Contributor Author

@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

  • Should I exploit the existing $CMSSW_BASE area (with mkdir $CMSSW_BASE/src/SkeletonTestPackage in the script)? But what to do in absence of developer area?
  • I'd like to check that the script output compiles and passes clang-format and clang-tidy. Are those feasible from scripts run by scram b runtests?
  • Should these tests actually be driven separately from scram b runtests? (similar to addOnTests.py)

(spurred by https://mattermost.web.cern.ch/cms-o-and-c/pl/kgpdtbtdzfyi8ezs9brdqf7awc)

@smuzaffar
Copy link
Contributor

@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

@makortel
Copy link
Contributor Author

makortel commented Mar 3, 2022

Thanks @smuzaffar! I followed your suggestion in #37125, and at least in local tests it seems to work fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants