Differences between revisions 5 and 15 (spanning 10 versions)
Revision 5 as of 2022-04-01 11:23:45
Size: 770
Editor: PieterSmit
Comment:
Revision 15 as of 2023-06-29 07:32:45
Size: 1523
Editor: PieterSmit
Comment:
Deletions are marked like this. Additions are marked like this.
Line 5: Line 5:
   * https://github.com/networktocode/ntc-templates/
Line 7: Line 8:
   * setup python virtual env {{{
     python3 -m venv venv
     source venv/bin/activate
     }}}
Line 13: Line 9:
 * test new raw and yaml
   * install python yaml lib {{{
pip3 install ruamel.yaml
pip3 install textfsm
== Dev Setup ==
 * 2023 moved to invoke and docker away from direct python3 -m venv vev
   * Run tests on ntc-templates repo with {{{
pip3 install invoke. (or on mac $ brew install pyinvoke poetry python-toml ; poetry install )
# 1 time build test container
invoke build #or rebuild
# run test suite
invoke tests
Line 18: Line 18:
      
Line 19: Line 21:
$ fb=tests/cisco_nxos/show_ip_arp_detail/cisco_nxos_show_ip_arp_detail ; python3 development_scripts.py -c ${fb}.raw && cat ${fb}.yml # enter build/test container
invoke cli
fb=tests/cisco_nxos/show_ip_arp_detail/cisco_nxos_show_ip_arp_detail
invoke
gen-yaml-file ${fb}.raw && cat ${fb}.yml
Line 21: Line 26:


== Checkout remote branch in PR to verify ==
 1. Go to the remote repo and get the clone repo e.g. {{{ https://github.com/verbosemode/ntc-templates.git }}}
 1 Go to the remote repo and get the branch name e.g. {{{ cisco_xr_show_install_active }}}
 1. Add the repo as a remote on local repo {{{
 #git remote add -t <branch> <remote> <gitUrl>
 git remote add -t cisco_xr_show_install_active verbosemode#1105 https://github.com/verbosemode/ntc-templates.git
 #
 git fetch verbosemode#1105
 git checkout verbosemode#1105
 git remote -v
}}}

Dev/github-ntc-templates

Dev Setup

  • 2023 moved to invoke and docker away from direct python3 -m venv vev
    • Run tests on ntc-templates repo with

      pip3 install invoke. (or on mac $ brew install pyinvoke poetry python-toml ; poetry install )
      # 1 time build test container
      invoke build #or rebuild
      # run test suite
      invoke tests
    • test under test

      # enter build/test container
      invoke cli
      fb=tests/cisco_nxos/show_ip_arp_detail/cisco_nxos_show_ip_arp_detail 
      invoke gen-yaml-file ${fb}.raw && cat ${fb}.yml

Checkout remote branch in PR to verify

  1. Go to the remote repo and get the clone repo e.g.  https://github.com/verbosemode/ntc-templates.git  1 Go to the remote repo and get the branch name e.g.  cisco_xr_show_install_active 

  2. Add the repo as a remote on local repo

     #git remote add -t <branch> <remote> <gitUrl>
     git remote add -t cisco_xr_show_install_active  verbosemode#1105 https://github.com/verbosemode/ntc-templates.git
     #
     git fetch verbosemode#1105
     git checkout verbosemode#1105
     git remote -v

Errors and fix's

  • Error  ModuleNotFoundError: No module named 'ruamel' 

    • Fix: forgot to install needed packages

             python -m pip install ruamel.yaml
             python -m pip install textfsm

Dev/github-ntc-templates (last edited 2023-06-29 07:32:45 by PieterSmit)