Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 681c1fa

Browse files
committed
Final updates to CONTRIBUTING.md
1 parent d4e2891 commit 681c1fa

1 file changed

Lines changed: 60 additions & 21 deletions

File tree

CONTRIBUTING.md

Lines changed: 60 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
## How to contribute ##
1+
# How to contribute
22

33
The following are the guidelines everyone should use to contribute to utPLSQL.
44
Changes are welcome from all members of the Community.
55

6-
## Getting Started ##
6+
# Getting Started
77

88
1. Create a [GitHub Account](https://github.com/join).
9-
2. Fork the utPLSQL Repository and setup your local Repository.
10-
* Each of the steps below are detailed in the [how to Fork](https://help.github.com/articles/fork-a-repo) article!
9+
2. Fork the utPLSQL Repository and setup your local Repository. _See [how to Fork](https://help.github.com/articles/fork-a-repo) article_
10+
* Each of the steps below are detailed in **Get started with development** section.
1111
* Clone your Fork to your local machine.
1212
* Configure "upstream" remote to the [utPLSQL repository](https://github.com/utPLSQL/utPLSQL.git).
1313
3. For each change you want to make:
@@ -22,7 +22,7 @@ Changes are welcome from all members of the Community.
2222
* Submit a [Pull Request](https://help.github.com/articles/using-pull-requests) into develop branch.
2323
* Note: local and remote branches can be deleted after pull request has been merged.
2424

25-
## Coding Standards ##
25+
# Coding Standards
2626

2727
* We use snake case for all identifiers in PLSQL code. This separates keywords in names with underscores. `execute_test`
2828
* All code is lower case.
@@ -37,7 +37,7 @@ Changes are welcome from all members of the Community.
3737
* varchar2 lengths are set in characters not bytes
3838

3939

40-
## Configuring local environment ##
40+
# Configuring local environment
4141

4242
Your local environment can be of any flavor (Unix/Linux/Windows/Mac).
4343
At minimum you need to have Oracle database 11.2 XE accessible for the project and SYS account access to install and develop utPLSQL.
@@ -50,11 +50,14 @@ We use four different database accounts (users) for development process.
5050

5151

5252

53-
### To get started with development, follow the below steps.
53+
## Get started with development
54+
55+
To get started with development, follow the below steps.
5456

5557
_If you're using Windows, run the shell scripts using `GIT bash` - Windows-based bash command line._
5658

57-
**Clone your fork of utPLSQL git repository**
59+
### Clone your fork of utPLSQL git repository
60+
5861
```bash
5962
# clone your fork of utPLSQL
6063
git clone https://github.com/your account/utPLSQL.git utPLSQL
@@ -68,7 +71,7 @@ git remote add upstream https://github.com/utPLSQL/utPLSQL.git
6871
git fetch --all
6972
```
7073

71-
**Prepare environment script**
74+
### Prepare environment script
7275

7376
Copy the environment variables template `development/template.env.sh` to `development/env.sh`
7477
```bash
@@ -84,19 +87,22 @@ export CONNECTION_STR=127.0.0.1:1521/xe # Adjust the connect string
8487
export ORACLE_PWD=oracle # Adjust your local SYS password
8588
```
8689

87-
**Download utPLSQL release sources and utplsq-cli**
90+
### Download utPLSQL release sources and utplsq-cli
8891

89-
_The below script is fetching latest release version from utPLSQL repository. Latest release version is used for self-testing._
92+
The below script is fetching latest release version from utPLSQL repository. Latest release version is used for self-testing.
9093
```bash
9194
development/refresh_sources.sh
9295
```
9396

94-
**Setup local database for utPLSQL development**
97+
### Setup local database for utPLSQL development
98+
9599
```bash
96100
development/install.sh
97101
```
98102

99-
That's it! You now have the following:
103+
### That's it
104+
105+
You now have the following:
100106
- sources from `develop` branch of your fork of utPLSQL repository in `utPLSQL/ut3_latest_release` directory
101107
- sources from `master` branch of utPLSQL/utPLSQL repository in `utPLSQL/ut3_latest_release` directory
102108
- binaries of `utplsql-cli` in `utPLSQL/utPLSQL-cli` directory
@@ -106,27 +112,60 @@ That's it! You now have the following:
106112

107113
At any time, if you need to refresh your database, the below scripts might be helpful.
108114

109-
### Cleanup of utPLSQL installation in local database
115+
## Running unit tests
116+
117+
Currently we use two forms of unit tests in our CI build:
118+
- sql scripts as unit tests in the `old_tests` directory
119+
- utPLSQL v3 unit tests in the `test` directory
120+
121+
Before you push any changes and create a pull request to the utPLSQL project repository, make sure that all of the tests are executing successfully in your local environment.
122+
123+
Every new functionality needs to be documented by unit tests that cover both happy-path scenarios as well as edge-cases and exception paths.
124+
125+
> **Important notice:**
126+
> We do our best to keep utPLSQL covered with unit tests.
127+
> Lack of sufficient unit testing is a perfect reason for PR to be rejected.
128+
129+
To suite of legacy unit tests execute:
130+
```bash
131+
development/env.sh
132+
old_tests/runAll.sh
133+
```
134+
To run a full suite of unit tests execute:
135+
```bash
136+
development/env.sh
137+
test/install_and_run_tests.sh
138+
```
139+
140+
You can review the results of tests as well as see information about code coverage in `./old_tests/coverage.html, ./coverage.html` files.
141+
142+
143+
## Cleanup of utPLSQL installation in local database
144+
110145
```bash
111146
development/cleanup.sh
112147
```
113148

114-
### Reinstalling utPLSQL development in `ut3` schema
149+
## Reinstalling utPLSQL development in `ut3` schema
150+
115151
```bash
116152
development/refresh_ut3.sh
117153
```
118154

119-
Whenever a new version of utPLSQL or a new version of utPLSQL-cli is available, use `development/refresh_sources.sh` to refresh files in your local project folders.
155+
## Refreshing after release
156+
157+
Whenever a new version of utPLSQL or a new version of utPLSQL-cli is available, use `development/refresh_sources.sh` to refresh files in your local project folders.
158+
120159

121-
## Modules ##
160+
## Modules
122161

123162
Below diagram gives a high-level overview of utPLSQL v3 modules and their dependencies.
124163
Dependencies to `ut_util` are not shown as most of modules are depending on it.
125164

126165
![utPLSQL V3 Modules](development/utPSLQLv3-modules.png)
127166

128167

129-
## Build Environment ##
168+
## Build Environment
130169

131170
We are using private docker images to test utPLSQL for our Travis CI builds. The following versions of Oracle Database are being used.
132171

@@ -143,7 +182,7 @@ The build steps are simple if you already have some experience using Docker. You
143182
144183
> If you are new to Docker, you can start by reading the [Getting Started With Docker](https://docs.docker.com/engine/getstarted/) docs.
145184
146-
### Docker Build Notes ###
185+
### Docker Build Notes
147186

148187
* You need to comment out the VOLUME line. This step is required, because volumes are not saved when using `docker commit` command.
149188
* When the build process is complete, you will run the container to install the database. Once everything is set up and you see the message "DATABASE IS READY!", you may change the password and stop the running container. After the container is stopped, you can safely commit the container.
@@ -158,7 +197,7 @@ Variable | Description
158197
---------|------------
159198
**DOCKER_USER**<br />**DOCKER_PASSWORD** | _Your Docker Hub website credentials. They will be used to pull the private database images._
160199

161-
### SQLCL ###
200+
### SQLCL
162201

163202
Our build configuration uses SQLCL to run the scripts, and you need to configure a few additional secure environment variables. After the first build, the downloaded file will be cached.
164203

@@ -167,7 +206,7 @@ Variable | Description
167206
**ORACLE_OTN_USER<br />ORACLE_OTN_PASSWORD** | _Your Oracle website credentials. They will be used to download SQLCL._
168207

169208

170-
## New to GIT ##
209+
## New to GIT
171210

172211
If you are new to GIT here are some links to help you with understanding how it works.
173212

0 commit comments

Comments
 (0)