Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ install:
- pip install coveralls
- npm install -g markdownlint-cli
script:
- pytest tabpy-server/server_tests/ --cov=tabpy-server/tabpy_server
- pytest tabpy-tools/tools_tests/ --cov=tabpy-tools/tabpy_tools --cov-append
- export PYTHONPATH=./tabpy-server:./tabpy-tools:$PYTHONPATH
- pytest tests/unit --cov=tabpy-server/tabpy_server --cov=tabpy-tools/tabpy_tools --cov-append
- pytest tests/integration
- markdownlint .
after_success:
- coveralls
16 changes: 16 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: General",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "externalTerminal",
"env": {"${PYTHONTPATH}": "${PYTHONPATH};${workspaceRoot}/tabpy-server;${workspaceRoot}/tabpy-tools"}
}
]
}
16 changes: 13 additions & 3 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,19 @@
"git.enabled": true,
"files.exclude": {
"**/__pycache__": true,
"**/.pytest_cache": true
"**/.pytest_cache": true,
"**/*.egg-info": true,
"**/*.pyc": true
},
"python.linting.pylintEnabled": false,
"python.linting.flake8Enabled": true,
"python.linting.enabled": true
"python.linting.flake8Enabled": false,
"python.linting.enabled": true,
"python.testing.autoTestDiscoverOnSaveEnabled": true,
"python.testing.pyTestArgs": [
"tests"
],
"python.testing.unittestEnabled": true,
"python.testing.nosetestsEnabled": false,
"python.testing.pyTestEnabled": true,
"python.linting.pep8Enabled": true
}
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

- Added request context logging as a feature controlled with
TABPY_LOG_DETAILS configuration setting.
- Updated documentation for /info method
- Added integration tests

## v0.4

Expand Down
59 changes: 41 additions & 18 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@

- [Environment Setup](#environment-setup)
- [Prerequisites](#prerequisites)
- [Windows Specific Steps](#windows-specific-steps)
- [Linux and Mac Specific Steps](#linux-and-mac-specific-steps)
- [Cloning TabPy Repository](#cloning-tabpy-repository)
- [Setting Up Environment](#setting-up-environment)
- [Unit Tests](#unit-tests)
- [Integration Tests](#integration-tests)
- [Code Coverage](#code-coverage)
- [TabPy in Python Virtual Environment](#tabpy-in-python-virtual-environment)
- [Documentation Updates](#documentation-updates)
- [TabPy with Swagger](#tabpy-with-swagger)
- [Code styling](#code-styling)
Expand All @@ -30,10 +34,10 @@ be able to work on TabPy changes:
- Create a new branch for your changes.
- When changes are ready push them on github and create merge request.

## Windows Specific Steps
## Cloning TabPy Repository

1. Open a windows command prompt.
2. In the command prompt, navigate to the folder in which you would like to save
1. Open your OS shell.
2. Navigate to the folder in which you would like to save
your local TabPy repository.
3. In the command prompt, enter the following commands:

Expand All @@ -42,36 +46,55 @@ be able to work on TabPy changes:
cd TabPy
```

To start a local TabPy instance:
## Setting Up Environment

Before making any code changes run environment setup script. For
Windows the next command from the repository root folder:

```sh
startup.cmd
utils\set_env.cmd
```

To run the unit test suite:
and for Linux or Mac the next command from the repository root folder:

```sh
python tests\runtests.py
utils/set_env.sh
```

Alternatively you can run unit tests to collect code coverage data. First
install `pytest`:
## Unit Tests

TabPy has test suites for `tabpy-server` and `tabpy-tools` components.
To run the unit test use `pytest` which you may need to install first
(see [https://docs.pytest.org](https://docs.pytest.org) for details):

```sh
pip install pytest
pytest tests/unit
```

And then run `pytest` either for server or tools test, or even combined:
Check `pytest` documentation for how to run individual tests or set of tests.

## Integration Tests

Integration tests can be executed with the next command:

```sh
pytest tests/integration
```

## Code Coverage

You can run unit tests to collect code coverage data. To do so run `pytest`
either for server or tools test, or even combined:

```sh
pytest tabpy-server/server_tests/ --cov=tabpy-server/tabpy_server
pytest tabpy-tools/tools_tests/ --cov=tabpy-tools/tabpy_tools --cov-append
pytest tests --cov=tabpy-server/tabpy_server --cov=tabpy-tools/tabpy_tools --cov-append
```

## Linux and Mac Specific Steps
## TabPy in Python Virtual Environment

If you have downloaded Tabpy and would like to manually install Tabpy Server
not using pip then follow the steps below [to run TabPy in Python virtual environment](docs/tabpy-virtualenv.md).
It is possible (and recommended) to run TabPy in a virtual environment, more
details are on
[TabPy in Python virtual environment](docs/tabpy-virtualenv.md) page.

## Documentation Updates

Expand Down
Loading