You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The virtualization-sdk repository has a Gradle task that creates a virtualenv and builds the code locally. It can be triggered from the root directory of the source tree using the command:
46
-
47
-
`./gradlew build`
48
-
49
-
### Run Unit Tests
50
-
51
-
Unit tests for the virtualization-sdk repository can be triggered from the root directory of the source tree using Gradle with the command:
52
-
53
-
`./gradlew test`
45
+
For development instructions, refer to [README-dev.md](https://github.com/delphix/virtualization-sdk/blob/develop/README-dev.md).
54
46
55
47
## Asking for Help
56
48
Please raise a GitHub issue to ask for help with appropriate GitHub tag <TBD - Label for help>.
@@ -74,7 +66,7 @@ Some guidelines for Pull Requests:
74
66
Once the pull request has required approvals from code owners of the repository, the code owner will merge the pull request into the actual virtualization-sdk repository.
75
67
76
68
### Code Owners
77
-
Code owners defined by the codeowners file in the repository are the gatekeepers of the repository. For a pull request to be merged, it requires approval from at least 2 codeowners.
69
+
Code owners defined by the codeowners file in the repository are the gatekeepers of the repository. For a pull request to be merged, it requires approval from at least one codeowner.
78
70
79
71
## Testing and CI/CD
80
72
CI/CD for this repository is managed through GitHub Actions. All the checks need to succeed for the pull request to be merged.
@@ -90,5 +82,6 @@ Commit messages for new changes must meet the following guidelines:
90
82
`Fixes #123 Format of error is incorrect`
91
83
92
84
`Optional Description of the issue`
85
+
* If the commit doesn't address a specific issue, it should include a description of changes.
Copy file name to clipboardExpand all lines: README-dev.md
+66-69
Original file line number
Diff line number
Diff line change
@@ -21,58 +21,65 @@ This is done automatically by `dvp build`.
21
21
This is what causes the slightly different workflows in development. Changes to `tools` are completely isolated from the
22
22
Delphix Engine and wrappers changes only impact the plugin build.
23
23
24
-
## Development process
24
+
## Development
25
+
26
+
### Development process
25
27
26
28
At a very high level, our development process usually looks like this:
27
29
28
30
1. Create a fork of the delphix/virtualization-sdk repository.
29
31
2. Clone the forked repository.
30
-
3. Make changes to SDK code. Test these changes manually and with unit tests. Iterate on this until you have everything working.
31
-
4. Commit your changes and build all Python package distributions. Make sure the version number of the packages is updated appropriately.
32
-
5. Publish Python distributions to artifactory.
33
-
7. Run blackbox against the newly uploaded SDK version.
34
-
7. Publish a pull request to the delphix/virtualization-sdk once your code is ready for review.
35
-
8. Once the pull request is approved, it will merged into delphix/virtualization-sdk repository.
32
+
3. Make changes to SDK code. Test these changes manually and with [unit tests](#unit-testing). Iterate on this until you have everything working.
33
+
4. Bump major/minor/patch/build version depending on the scope of the change. Refer to [versioning section](#versioning) for instructions.
34
+
5. Commit your changes. Refer to the [contribution guideline](https://github.com/delphix/virtualization-sdk/blob/develop/CONTRIBUTING.md#commit-message-format)
35
+
for commit message format.
36
+
6. Make sure the version number of the packages is updated appropriately in your commit. That includes all files mentioned
37
+
in `.bumpversion.cfg` and the string in `test_get_version()` inside `test_package_util.py`.
38
+
7. Push your changes to a branch in the forked repository.
39
+
8. Run [blackbox tests](#functional-blackbox-testing) against that branch.
40
+
9. Publish a pull request to the delphix/virtualization-sdk once your code is ready for review.
41
+
10. Once the pull request is approved, merge the pull request into delphix/virtualization-sdk repository.
36
42
37
43
These steps are described in more detail below.
38
44
39
-
## Local SDK Development
45
+
### Development environment
46
+
Development should be done in a personal virtualenv. To setup the virtual environment:
40
47
41
-
To setup local development, refer to README-dev.md in the `tools` directory. This walks through the setup of a local virtualenv for development. This should be done for _all_ SDK changes.
48
+
1.`virtualenv /path/to/env/root`. This should be a Python 2.7 virtualenv.
49
+
2.`source ~/path/to/env/root/bin/activate`.
42
50
43
-
### Configure pip index
51
+
### Installing the SDK from source
52
+
To install the SDK, follow these steps:
44
53
45
-
`dvp build` executes `pip` to install the wrappers. By default `pip` looks at pypi.org for packages to install. Internal builds of the SDK are published to artifactory, not pypi. In order to configure pip to look at artifactory, create a file at `<virtualenv-root>/pip.conf` that contains:
54
+
1. Create a file at
55
+
`<virtualenv-root>/pip.conf` that contains:
56
+
57
+
```
58
+
[install]
59
+
index-url=https://pypi.org/simple/
60
+
extra-index-url=https://test.pypi.org/simple/
61
+
```
62
+
63
+
One of the SDK dependencies - dvp-api - is currently hosted on [TestPyPi](https://test.pypi.org/project/dvp-api/).
64
+
By default `pip` looks at pypi.org for packages to install. In order to successfully install the SDK, you have to
65
+
configure pip to search an additional package repository - test.pypi.org.
66
+
2. Go into one of the package directories (common, dvp, libs, platform, tools) and run the commands below.
67
+
3. Install the package's development dependencies: `pip install -r requirements.txt`.
68
+
4. Install the package itself (use `-e` flag if you want to install the package in editable mode): `pip install .`.
To better understand how to develop and test `tools` changes, see README-dev.md in the `tools` directory.
56
-
57
-
### Wrappers changes
58
-
59
-
Run `dvp build --dev` to build your plugin and then upload it to a Delphix Engine to test.
60
-
61
-
The wrappers are built with the plugin. `dvp build` has a hidden `--dev` flag. This builds `common`, `libs`, and `platform` locally and bundles them with the plugin. A special configuration entry is needed in your dvp config file which is located at `~/.dvp/config`:
62
-
63
-
```
64
-
[dev]
65
-
vsdk_root = /path/to/vsdk_repo_root
66
-
```
73
+
To better understand how to develop and test `tools` changes, see [tools/README-dev.md](https://github.com/delphix/virtualization-sdk/blob/develop/tools/README-dev.md).
67
74
68
75
## Versioning
69
76
70
77
The SDK is shipped as five Python packages that are currently versioned and shipped together: dvp, dvp-common, dvp-libs,
71
78
dvp-platform, and dvp-tools.
72
79
73
80
The first thing to do is to change the version number of all the packages. Our versioning scheme follows the rules of
74
-
semantic versioning in order to help developers manage their "dependency hell". We use bump2version
75
-
(https://github.com/c4urself/bump2version) to make the version management of all five packages easier. Semantic versioning rules are the following:
81
+
semantic versioning in order to help developers manage their "dependency hell". We use [bump2version](https://github.com/c4urself/bump2version)
82
+
to make the version management of all five packages easier. Semantic versioning rules are the following:
76
83
77
84
```
78
85
Given a version number MAJOR.MINOR.PATCH, increment the:
@@ -90,55 +97,45 @@ If you want to bump the build number from `1.1.0-internal-7` to `1.1.0-internal-
90
97
91
98
If you want to bump the major/minor/patch version, run `bumpversion [major|minor|patch]`.
92
99
93
-
If you want to get rid of the pre-release label (bump from `1.1.1-internal-7` to `1.1.0`), run `bumpversion release`.
100
+
If you want to get rid of the pre-release label (bump from `1.1.0-internal-7` to `1.1.0`), run `bumpversion release`.
94
101
95
102
## Testing
96
103
97
104
Currently, there are three types of SDK testing: unit, manual, and functional (blackbox).
98
105
99
106
### Unit Testing
100
107
101
-
Go into one of the package directories (common, dvp, libs, platform, tools) and run the following commands (if you haven't done it already):
102
-
1. Install the package's development dependencies: `pip install -r requirements.txt`.
103
-
2. Install the package itself in editable mode: `pip install -e .`.
104
-
3. Run unit tests: `python -m pytest src/main/python`.
108
+
Go into one of the package directories (common, dvp, libs, platform, tools) and follow these steps:
105
109
106
-
There's no way to locally run unit tests in all packages with one command. However, they will be run automatically through GitHub Actions when you open a pull request.
110
+
1. Install the package's development dependencies and package itself by following the directions in [the SDK installation section](#installing-the-sdk-from-source).
111
+
2. Run unit tests: `python -m pytest src/test/python`.
107
112
108
-
### Testing sdk-gate changes with app-gate code
113
+
There's no way to locally run unit tests in all packages with one command. However, they will be run automatically
114
+
through GitHub Actions when you open a pull request. You can always open a draft pull request
109
115
110
-
####Manual testing
116
+
### Manual testing
111
117
112
-
Run `dvp build --dev` to build your plugin and then upload it to a Delphix Engine to test.
118
+
#### Wrappers: dvp, common, platform, libs
119
+
The only way to manually test the new wrappers code is to build a plugin, upload it to a Delphix Engine and run through
120
+
all the standard workflows. The same workflows will be exercised by functional (blackbox) tests.
113
121
114
-
The wrappers are built with the plugin. `dvp build` has a hidden `--dev` flag. This builds `common`, `libs`, and `platform` locally and bundles them with the plugin. A special configuration entry is needed in your dvp config file which is located at `~/.dvp/config`:
115
-
116
-
```
117
-
[dev]
118
-
vsdk_root = /path/to/vsdk_repo_root
119
-
```
120
-
121
-
##### Functional (blackbox) testing
122
-
(Now) Let's assume you're working on the SDK version `1.1.0-internal-10`.
123
-
To run blackbox tests, follow these steps:
124
-
1. Navigate to each package directory (common, dvp, libs, platform, tools) and run `python setup.py sdist bdist_wheel`. This will build Python package distributions.
125
-
2. Run `./bin/upload.sh` to upload Python distributions to artifactory.
(Soon) We will be able to move to this process once blackbox runner can build Python distributions without using Gradle.
122
+
### Functional (blackbox) testing
131
123
To run blackbox tests, follow these steps:
132
-
1. Push your code to a branch in the forked repository on Github. Let's say the branch is called `feature1` in repository called `username/virtualization-sdk`.
1. There are two environment variables that need to be set in order to publish: `ARTIFACTORY_PYPI_USER` and `ARTIFACTORY_PYPI_PASS`.
139
-
140
-
`ARTIFACTORY_PYPI_USER` and `ARTIFACTORY_PYPI_PASS` are one set of credentials used to upload the Python distributions to our internal PyPI repositories. The credentials are the same for both internal PyPI repositories mentioned above.
141
-
142
-
-`ARTIFACTORY_PYPI_USER` and `ARTIFACTORY_PYPI_PASS` is the username/password combo given to you by whoever setup your Artifactory pypi account. This is an account separate from your Artifactory account. If you do not have one, please reach out to the `#artifactory` channel and request a `dvp-uploaders-python` account. See <https://docs.delphix.com/pages/viewpage.action?spaceKey=EO&title=Artifactory-instance#Artifactory-instance-SDKpythonpackages> for directions on how to add the account. These are used to upload the Python distributions to our internal PyPI repositories. The credentials are the same for both internal PyPI repositories mentioned above.
143
-
144
-
2.`twine` needs to be installed. This is a Python package that is used to upload Python distributions. If it's not installed, install it by running `pip install twine`.
124
+
1. Push your code to a branch in the forked repository on Github. Let's say the branch is called `my-feature` in repository called `<username>/virtualization-sdk`.
125
+
2. Navigate to the app-gate directory and start tests using `git blackbox`. For the guide on which test suite to use,
126
+
see the next sections.
127
+
128
+
At a minimum, each pull request should pass `appdata_python_samples` and `appdata_sanity` tests with a direct or staged plugin.
129
+
See the section below for the description of each test suite.
* appdata_sanity with a direct Python plugin on CentOS 7.3: `git blackbox -s appdata_sanity -c APPDATA_PYTHON_DIRECT_CENTOS73 -a --extra-params="-p virt-sdk-repo=https://github.com/<username>/virtualization-sdk.git -p virt-sdk-branch=my-feature"`,
135
+
* appdata_sanity with a staged Python plugin on CentOS 7.3: `git blackbox -s appdata_sanity -c APPDATA_PYTHON_STAGED_CENTOS73 -a --extra-params="-p virt-sdk-repo=https://github.com/<username>/virtualization-sdk.git -p virt-sdk-branch=my-feature"`.
136
+
137
+
#### Blackbox tests targeting the CLI (~80% CLI tests)
138
+
* virtualization_sdk (installs and tests a direct Python plugin on Ubuntu 18):
0 commit comments