Changes between Version 18 and Version 19 of DRM4G/Development


Ignore:
Timestamp:
Dec 12, 2016 8:15:16 PM (5 years ago)
Author:
minondoa
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DRM4G/Development

    v18 v19  
    5959
    6060
    61 [[br]]
    62 
    63 == Testing the DRM4G
     61
     62[[br]]
     63== Testing the DRM4G ==
    6464Once you've made the changes you wanted to, you'll want to install your version to be sure that your new feature is working properly.
    6565
     
    8989
    9090'''''For other ways to install the DRM4G, you can check [[wiki:DRM4G/Installation|here]].'''''
     91
     92[[br]]
     93
     94=== How to debug code ===
     95
     96You have at your disposal a number of ways to check what could have gone wrong when something breaks.
     97
     98----
     99'''''Via the DRM4G CLI'''''
     100* All of the ''drm4g commands'' can be executed in debug mode by adding the option "'''--dbg'''".
     101
     102----
     103'''''Via the logger'''''
     104* If there has been any error, chances are that you can find the cause by looking at DRM4G's log files, found in "__$DRM4G_DIR/.drm4g/var__"
     105 * The DRM4G is divided into different parts, and each one of them has its own logger.
     106 * By default, the logger level is set to ''INFO'' for all of them. To see all of the log messages that the DRM4G can record, you'll have to modify the file "'''__$DRM4G_DIR/.drm4g/etc/logger.conf__'''" and change the level of the logger to "'''DEBUG'''" for each part that you wish to check.
     107
     108----
     109'''''Via the job's logs'''''
     110* In addition, all of the individual jobs submitted have their own log files. They can help you see in which phase did the program stop working.
     111 * They are grouped in folders by their job ID, every hundred jobs. They can be located in "__$DRM4G_DIR/.drm4g/var__".
     112  * The folders will look like this: "'''__000-099__'''", "'''__100-199__'''", ...
     113 * Another way to view them is to use the command `drm4g job log <job_id>`
    91114
    92115
     
    215238
    216239
    217 [[br]]
    218 == Testing the DRM4G ==
    219 Once you've made the changes you wanted to, you'll want to install your version to be sure that your new feature is working properly.
    220 
    221 Just in case you would like to try out different versions, we recommend you use a __virtual environment__ to test it.
    222 
    223  * [[http://pythoncentral.io/how-to-install-virtualenv-python/|Here]] you can find a tutorial on how to install a virtual environment, or you can look for one on your own.
    224 
    225 Before you can install and try out your own version, you'll have to build your own package:
    226 * Open a terminal in the folder where your repository is located.
    227 * Run the command `python setup.py sdist`
    228 
    229 This will create a a distribution package under a folder called '''dist'''.
    230 
    231 
    232 === Installing your version in a virtual environment ===
    233 
    234 Go to wherever you have your virtual environment, open a terminal and execute the following commands:
    235 
    236 {{{#!sh
    237 source bin/activate
    238 export DRM4G_DIR = $PWD/conf
    239 pip install path/to/drm4g/package
    240 }}}
    241  ^DRM4G_DIR is where the configuration files will be installed. More information [[wiki:DRM4G/Installation#OptionalEnvironmentVariables|here]].^
    242 
    243 And that's it. Now you can use and test your own version of DRM4G.[[BR]]
    244 
    245 '''''For other ways to install the DRM4G, you can check [[wiki:DRM4G/Installation|here]].'''''
    246 
    247 
    248 === How to debug code ===
    249 
    250 You have at your disposal a number of ways to check what could have gone wrong when something breaks.
    251 
    252 ----
    253 '''''Via the DRM4G CLI'''''
    254 * All of the ''drm4g commands'' can be executed in debug mode by adding the option "'''--dbg'''".
    255 
    256 ----
    257 '''''Via the logger'''''
    258 * If there has been any error, chances are that you can find the cause by looking at DRM4G's log files, found in "__$DRM4G_DIR/.drm4g/var__"
    259  * The DRM4G is divided into different parts, and each one of them has its own logger.
    260  * By default, the logger level is set to ''INFO'' for all of them. To see all of the log messages that the DRM4G can record, you'll have to modify the file "'''__$DRM4G_DIR/.drm4g/etc/logger.conf__'''" and change the level of the logger to "'''DEBUG'''" for each part that you wish to check.
    261 
    262 ----
    263 '''''Via the job's logs'''''
    264 * In addition, all of the individual jobs submitted have their own log files. They can help you see in which phase did the program stop working.
    265  * They are grouped in folders by their job ID, every hundred jobs. They can be located in "__$DRM4G_DIR/.drm4g/var__".
    266   * The folders will look like this: "'''__000-099__'''", "'''__100-199__'''", ...
    267  * Another way to view them is to use the command `drm4g job log <job_id>`
    268240
    269241[[br]]
     
    274246
    275247In this section you'll find the guidelines of how we tackle the development process.
     248* A section has already been written specifying [#TestingtheDRM4G how to test the DRM4G].
    276249
    277250As mentioned above, to us, our ''central'' repository will be a private one hosted by '''''!GitBucket''''', but in addition we have a second public one hosted in '''''!GitHub''''' to make the DRM4G accessible to anyone that might want to contribute to the project.
     
    293266git push -u origin <branch_name>
    294267}}}
    295 Something to remember then, is that when you've finished your work on the branch, you musn't forget to eliminate it from the remote repository.
     268Something to remember then, is that when you've finished your work on the branch, you mustn't forget to eliminate it from the remote repository.
    296269{{{#!sh
    297270git branch -d <branch_name> #deletes the branch from your local repository