Comments (7)
@jrha any suggestions?
from template-library-core.
@stdweird what is the use case? What do you want to put in such a directory? Based on my experience unit testing templates doesn't really make sense. The approach I tried to push so far is to have a set of examples that you compile. This is what is done by create-vanilla-SCDB.sh
in scdb
repo. The main test that can be done is to check that you can compile successfully the various profiles as in most changes, you expect some modification in the XML/Json generated.
Another use case is when you do template refactoring. In this particular situation you generally want to ensure that the resulting profile is the same. Again, unit testing the template that you modified doesn't really make sense because you may need to define various things before callng the template. What I have been personnally doing for 10 years that I am doing template development (with a lot of refactoring!) is using the SCDB-provided compare_profiles
script (it is not linked in SCDB in any way, except the default path for finding profiles) that list the profiles that have been modified (based on a reference version that I make by copying the current profiles before compiling the modification) and with -v
display a text diff of the modified profiles. This way you can easily spot problems, in particular if you don't expect any modification in the profile. I am typically doing this with all the GRIF profiles (# 1000), providing a good chance to spot any issue.
Is your need different?
from template-library-core.
See e.g. #102
I started cleaning up the pan/functions, and than it is better for some simpler tests to make really basic stuff still works (in this case, the examples in the annotation).
obviously, more complex test cases like the SCDB based build tests cover more realistic cases and can only make the testing more complete.
from template-library-core.
I was about to comment in #102 that I am not at all convinced by the value of these tests. And their value is really limited to functions, I don't see any other use cases really possible. If this is really adopted, not that we also need to add get_template_library
script in the release
repo that is (should be) the real way to obtain the template library (relying on tar file is painful as in some directories, you need to check out several production branches). It is certainly not a major change in get_template_library
but we should not forget to do it.
from template-library-core.
it allows you to test functions individually and thus catch problems very early. imagine a subtle issue in npush
, it will be show up in the SCDB test, but tracking it down to the issue in npush might take a while.
it's complementary, not meant as a replcement.
the other case this allows is testing error conditions, but i haven't come up with a proper framework for that.
from template-library-core.
@jouvin are you really trying to suggest that unit testing Pan code would not valuable?
from template-library-core.
Not exactly... I'm discussing if setting up this separate test framework is worth the effort. I have the feeling that we could do it with the "standard" template library testing tool (that I'd like to see run at each PR!), even adding some "proto-profiles" doing unit testing of the functions rather than compiling a full profile. I may come with a proposal around this, if you think it can be a good approach.
from template-library-core.
Related Issues (20)
- add absolute_path type
- Change type legacy_binary_affirmation_string to legacy_yes_or_no_string HOT 3
- Add /system/vm in the tree HOT 4
- add valid_interface type HOT 2
- functions/package: change values for PKG_VERSION_xxx constants HOT 1
- Missing AII freeipa templates
- What is oldnames intended for? HOT 1
- quattor/functions/network: boot_nic returns last, not first boot device
- remove get_subnet_params from quattor/functions/network HOT 3
- update partition flags HOT 2
- component authconfig : krb5_realm = ARRAY(0x39a5830) HOT 1
- component authconfig : There is no "use_object_class" in the sssd configuration HOT 1
- Consider validation of '/system/archetype/os/name' HOT 5
- Revert os and model fields structure archetype to Aquilon standard HOT 3
- Aquilon schema cleanup HOT 1
- 18.6.0: linux_capability type regexp incorrect
- types: aquilon: add new structure_entitlements in the system parameters
- at some point the in the future, remove the blockdevices_tmpfs_type type HOT 1
- opennebula: ds_mad can't be set for a system datastore
- schema ntpd_tinker_options/step should be "double", not "long"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from template-library-core.