Package: doppel-cli
doppel-clidoppel-cliis an integration testing framework for testing API similarity across languages.What is the value of keeping the same public interface?This project tests API consistency in libraries across languages.Why is this valuable?For developers:less communication overhead implementing changes across languagesforcing function to limit growth in complexity of the public APIFor users:no need to re-learn the API when switching languagesform better expectations when switching languagesFor more on this, click the link below to see this talk from thesatRdays Chicago 2019conference:DocumentationFor the most up-to-date documentation, please seehttps://doppel-cli.readthedocs.io/en/latest/.Getting starteddoppel-clican be installed from source just like any other python package.python setup.py installYou can also install from PyPi, the official package manager for Python. To avoid conflicts with the existingdoppelproject on that repository, it is distributed asdoppel-cli.pip install doppel-cliR requirementsIn order to usedoppelon R packages, you will need the R packages shown in the following installation commands:Rscript -e "
    install.packages(
        c('argparse', 'futile.logger', 'jsonlite', 'R6')
        , repos = 'http://cran.rstudio.com'
    )
"Example: Testing continuity between R and Python implementationsIn this example, I'll show how to usedoppelto test continuity between R and Python implementations of the same API. For this example, I used theargparselibrary.NOTE: This example assumes that you already haveargparseinstalled locally.If you don't run one or both of these:Rscript -e "install.packages('argparse')"
pip install argparseFirst, you need to generate special files thatdoppeluses to store information about a project's API. These are created using thedoppel-describetool.PACKAGE=argparse

# Create temporary directory to store output files
mkdir $(pwd)/test_data

# The R package
doppel-describe \
    -p ${PACKAGE} \
    --language R \
    --data-dir $(pwd)/test_data

# The python package
doppel-describe \
    -p ${PACKAGE} \
    --language python \
    --data-dir $(pwd)/test_dataCool! Let's do some testing!doppel-testcan be used to compare multiple packages.doppel-test \
    --files $(pwd)/test_data/python_${PACKAGE}.json,$(pwd)/test_data/r_${PACKAGE}.json \
    | tee out.log \
    | catThis will yield something like this:Function Count
==============
+---------------------+----------------+
|   argparse [python] |   argparse [r] |
+=====================+================+
|                   0 |              1 |
+---------------------+----------------+


Function Names
==============
+-----------------+---------------------+----------------+
| function_name   | argparse [python]   | argparse [r]   |
+=================+=====================+================+
| ArgumentParser  | no                  | yes            |
+-----------------+---------------------+----------------+

Function Argument Names
=======================
No shared functions.

Class Count
===========
+---------------------+----------------+
|   argparse [python] |   argparse [r] |
+=====================+================+
|                   9 |              0 |
+---------------------+----------------+


Class Names
===========
+-------------------------------+---------------------+----------------+
| class_name                    | argparse [python]   | argparse [r]   |
+===============================+=====================+================+
| MetavarTypeHelpFormatter      | yes                 | no             |
+-------------------------------+---------------------+----------------+
| ArgumentParser                | yes                 | no             |
+-------------------------------+---------------------+----------------+
| FileType                      | yes                 | no             |
+-------------------------------+---------------------+----------------+
| HelpFormatter                 | yes                 | no             |
+-------------------------------+---------------------+----------------+
| RawDescriptionHelpFormatter   | yes                 | no             |
+-------------------------------+---------------------+----------------+
| Action                        | yes                 | no             |
+-------------------------------+---------------------+----------------+
| ArgumentDefaultsHelpFormatter | yes                 | no             |
+-------------------------------+---------------------+----------------+
| Namespace                     | yes                 | no             |
+-------------------------------+---------------------+----------------+
| RawTextHelpFormatter          | yes                 | no             |
+-------------------------------+---------------------+----------------+


Class Public Methods
====================
No shared classes.

Arguments in Class Public Methods
=================================
No shared classes.

Test Failures (12)
===================
1. Function 'ngettext()' is not exported by all packages

2. Function 'ArgumentParser()' is not exported by all packages

3. Packages have different counts of exported classes! argparse [python] (9), argparse [r] (0)

4. Class 'HelpFormatter()' is not exported by all packages

5. Class 'Namespace()' is not exported by all packages

6. Class 'RawDescriptionHelpFormatter()' is not exported by all packages

7. Class 'ArgumentParser()' is not exported by all packages

8. Class 'MetavarTypeHelpFormatter()' is not exported by all packages

9. Class 'Action()' is not exported by all packages

10. Class 'ArgumentDefaultsHelpFormatter()' is not exported by all packages

11. Class 'FileType()' is not exported by all packages

12. Class 'RawTextHelpFormatter()' is not exported by all packagesAs you can see above, theargparsePython package has 9 exported classes while the R package has none.Fromdoppel's perspective, this is considered a test failure. If you runecho $?in the terminal, should should see1printed. Returning a non-zero exit code like this tells CI tools likeTravisthat the test was a failure, makingdoppeluseful for CI (more on this in a future example).You may be thinking "well wait, surely you'd want to test for way more stuff than just counts of classes and functions, right?". Absolutely! Seethe project issues issuesfor a backlog of features I'd like to add. PRs are welcomed!!!To learn more about the things that are currently configurable, you can run:doppel-describe --helpanddoppel-test --helpContributingBug reports, questions, and feature requests should be directed tothe issues page.SeeCONTRIBUTING.mdfor information on how to contribute.