Skip to content

Commit f20fb65

Browse files
suggoitanoshiManthanKeim
authored andcommitted
Sync Templates
Create tox.rst tox.rst explains how to set up coala in tox properly. Update tox.rst Update tox.rst Update tox.rst Update tox.rst Update tox.rst tox.rst: Documentation file for coala in tox This file ensures that coala is successfully installed in tox properly. Closes coala#344 Update tox.rst Update tox.rst sample tox.rst tox.rst: explains how to setup coala with tox closes coala#344 Update tox.rst Update tox.rst Update tox.rst Update tox.rst tox.rst: Documentation file for coala in tox This file ensures that coala is successfully installed in tox properly. Closes coala#344 Update tox.rst Update tox.rst sample tox.rst
1 parent 9d5b000 commit f20fb65

File tree

2 files changed

+181
-9
lines changed

2 files changed

+181
-9
lines changed

.gitignore

+68-9
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,9 @@ venv.bak/
115115
.dmypy.json
116116
dmypy.json
117117

118+
# Pyre type checker
119+
.pyre/
120+
118121
# VirtualEnv rules
119122
# Virtualenv
120123
# http://iamzed.com/2009/05/07/a-primer-on-virtualenv/
@@ -390,17 +393,11 @@ tmtags
390393
#
391394
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
392395

393-
## User settings
394-
xcuserdata/
395-
396-
## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
397-
*.xcscmblueprint
398-
*.xccheckout
399-
400-
## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
396+
## Build generated
401397
build/
402398
DerivedData/
403-
*.moved-aside
399+
400+
## Various settings
404401
*.pbxuser
405402
!default.pbxuser
406403
*.mode1v3
@@ -409,6 +406,68 @@ DerivedData/
409406
!default.mode2v3
410407
*.perspectivev3
411408
!default.perspectivev3
409+
xcuserdata/
410+
411+
## Other
412+
*.moved-aside
413+
*.xccheckout
414+
*.xcscmblueprint
415+
416+
## Obj-C/Swift specific
417+
*.hmap
418+
*.ipa
419+
*.dSYM.zip
420+
*.dSYM
421+
422+
## Playgrounds
423+
timeline.xctimeline
424+
playground.xcworkspace
425+
426+
# Swift Package Manager
427+
#
428+
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
429+
# Packages/
430+
# Package.pins
431+
# Package.resolved
432+
.build/
433+
434+
# CocoaPods
435+
#
436+
# We recommend against adding the Pods directory to your .gitignore. However
437+
# you should judge for yourself, the pros and cons are mentioned at:
438+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
439+
#
440+
# Pods/
441+
#
442+
# Add this line if you want to avoid checking in source code from the Xcode workspace
443+
# *.xcworkspace
444+
445+
# Carthage
446+
#
447+
# Add this line if you want to avoid checking in source code from Carthage dependencies.
448+
# Carthage/Checkouts
449+
450+
Carthage/Build
451+
452+
# fastlane
453+
#
454+
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
455+
# screenshots whenever they are needed.
456+
# For more information about the recommended setup visit:
457+
# https://docs.fastlane.tools/best-practices/source-control/#source-control
458+
459+
fastlane/report.xml
460+
fastlane/Preview.html
461+
fastlane/screenshots/**/*.png
462+
fastlane/test_output
463+
464+
# Code Injection
465+
#
466+
# After new code Injection tools there's a generated folder /iOSInjectionProject
467+
# https://github.com/johnno1962/injectionforxcode
468+
469+
iOSInjectionProject/
470+
412471

413472
# Eclipse rules
414473

Users/tox.rst

+113
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
What is Tox?
2+
===============
3+
4+
tox is a generic virtualenv management and test command line tool you can use
5+
for:
6+
7+
- checking your package installs correctly with different Python versions and
8+
interpreters
9+
- running your tests in each of the environments, configuring your test tool
10+
of choice
11+
- acting as a frontend to Continuous Integration servers, greatly reducing
12+
boilerplate and merging CI and shell-based testing.
13+
14+
taken from `tox.readthedocs.io
15+
<https://tox.readthedocs.io/en/latest/>`_.
16+
17+
Basic example.
18+
----------------------------------------------------------------
19+
First, install tox with pip install tox. Then put basic information about
20+
your project and the test
21+
environments you want your project to run in into a tox.ini file residing
22+
right next to your setup.py file:
23+
24+
::
25+
26+
# content of: tox.ini , put in same dir as setup.py
27+
[tox]
28+
envlist = py27,py36
29+
[testenv]
30+
deps = pytest # install pytest in the virtualenv where commands
31+
will be executed
32+
commands =
33+
# whatever extra steps before testing might be necessary
34+
pytest # or any other test runner that you might use
35+
36+
.. note::
37+
38+
You can also try generating a tox.ini file automatically, by running
39+
tox-quickstart and then answering a few simple questions.
40+
To sdist-package, install and test your project against Python2.7 and
41+
Python3.6, just type:
42+
43+
::
44+
45+
tox
46+
47+
.. note::
48+
49+
and watch things happening (you must have python2.7 and python3.6
50+
installed in your environment otherwise you will see errors). When
51+
you run tox a second time you’ll note that it runs much faster
52+
because it keeps track of virtualenv details and will not recreate or
53+
re-install dependencies.You also might want to checkout tox configuration
54+
and usage examples to get some more ideas.
55+
56+
Sections
57+
--------
58+
The ``tox.ini`` file has a number of top level sections defined by ``[ ]``
59+
and subsections within those. For complete documentation
60+
on all subsections inside of a tox section please refer to the tox
61+
documentation.
62+
63+
- ``tox`` : This section contains the ``envlist`` which is used to create
64+
our dynamic matrix. Refer to the `section here <http://tox.readthedocs.io/
65+
en/latest/config.html#generating-environments-conditional-settings>`_ for
66+
more information on how the ``envlist`` works.
67+
68+
- ``purge`` : This section contains commands that only run for scenarios
69+
that purge the cluster and redeploy. You'll see this section being reused in
70+
``testenv``with the following syntax: ``{[purge]commands}``
71+
72+
- ``update`` : This section contains commands taht only run for scenarios
73+
that
74+
deploy a cluster and then upgrade it to another Ceph version.
75+
76+
- ``testenv`` : This is the main section of the ``tox.ini`` file and is run
77+
on every scenario. This section contains many *factors* that define
78+
conditional settings depending on the scenarios defined in the
79+
``envlist``.
80+
For example, the factor``centos7_cluster`` in the ``changedir`` subsection
81+
of ``testenv`` sets the directory that tox will change do when that factor
82+
is selected. This is an important behavior that allows us to use the same
83+
``tox.ini`` and reuse commands while tweaking certain sections per testing
84+
scenario.
85+
86+
Modifying or Adding environments
87+
--------------------------------
88+
89+
The tox environments are controlled by the ``envlist`` subsection of the
90+
``[tox]`` section. Anything inside of ``{}`` is considered a *factor* and
91+
will be included
92+
in the dynamic matrix that tox creates. Inside of ``{}`` you can include
93+
a comma separated list of the *factors*. Do not use a hyphen (``-``) as part
94+
of the *factor* name as those are used by tox as the separator between
95+
different factor sets.
96+
97+
For example, if wanted to add a new test *factor* for the next Ceph
98+
release of luminious this is how you'd accomplish that. Currently, the first
99+
factor set in our ``envlist``
100+
is used to define the Ceph release (``{jewel,kraken,rhcs}-...``). To add
101+
luminous you'd change that to look like ``{luminous,kraken,rhcs}-...``.
102+
In the ``testenv`` section
103+
this is a subsection called ``setenv`` which allows you to provide environment
104+
variables to the tox environment and we support an environment variable
105+
called ``CEPH_STABLE_RELEASE``.
106+
To ensure that all the new tests that are created by adding the luminous
107+
*factor* you'd do this in that section:
108+
``luminous: CEPH_STABLE_RELEASE=luminous``.
109+
110+
Note
111+
112+
For more information about Tox configuration, consult the
113+
`official documentation <https://tox.readthedocs.io/en/latest/>`_.

0 commit comments

Comments
 (0)