Skip to content

Commit eb850ef

Browse files
authored
Merge pull request #238 from cybertk/0.5.3
v0.5.3
2 parents 8ac502e + 0cb0335 commit eb850ef

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1680
-760
lines changed

.editorconfig

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
###
2+
### .editorconfig <http://editorconfig.org/>
3+
###
4+
5+
6+
## Topmost EditorConfig file
7+
root = true
8+
9+
## UTF8, Unix-style newlines, newline ends every file, trim trailing whitespace
10+
[*]
11+
charset = utf-8
12+
end_of_line = lf
13+
insert_final_newline = true
14+
trim_trailing_whitespace = true
15+
16+
## Source code: 2 space indentation
17+
[*.coffee,*.js]
18+
indent_style = space
19+
indent_size = 2
20+
21+
## RAML: 2 space indentation
22+
[*.raml]
23+
indent_style = space
24+
indent_size = 2
25+
26+
## Config files: 2 space indentation
27+
[*.json,*.yml,*.yaml]
28+
indent_style = space
29+
indent_size = 2
30+
31+
## Matches the exact files either package.json or .travis.yml
32+
[{package.json,.travis.yml}]
33+
indent_style = space
34+
indent_size = 2
35+

.gitignore

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,37 @@
1-
# Mac shit
1+
###
2+
### .gitignore
3+
###
4+
5+
## Mac shit
26
.DS_Store
37

4-
# Logfiles
5-
logs
6-
*.log
8+
## Editor-related tempfiles
9+
.*.sw[op]
10+
*~
711

8-
# Runtime data
9-
pids
10-
*.pid
11-
*.seed
12+
## Logfiles
13+
*.log
14+
logs/
1215

13-
# Directory for instrumented libs generated by jscoverage/JSCover
14-
lib-cov
16+
## Build tool configuration files and intermediate storage
17+
.grunt/
1518

16-
# Coverage directory used by tools like istanbul
17-
coverage
19+
# Node/npm
20+
.node_repl_history
21+
.npm/
1822

19-
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
20-
.grunt
23+
## Package dependencies
24+
node_modules/
2125

22-
# Compiled binary addons (http://nodejs.org/api/addons.html)
23-
build/Release
26+
## Coverage reports and instrumented source
27+
.nyc_output/
28+
coverage/
29+
lib-cov/
30+
lib/*.js
2431

25-
# Dependency directory
26-
# Deployed apps should consider commenting this line out:
27-
# see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git
28-
node_modules
32+
## `npm pack` artifact
33+
abao-[0-9]*.[0-9]*.[0-9]*.tgz
2934

30-
# Generated from CoffeeScript source
31-
lib/*.js
32-
tests/unit/*.js
35+
## dotenv environment variables file
36+
.env
3337

.markdownlint.json

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"default": true,
3+
"header-style": { "style": "atx" },
4+
"ul-style": { "style": "asterisk" },
5+
"ul-indent": { "indent": 2 },
6+
"no-multiple-blanks": { "maximum": 2 },
7+
"line-length": { "line_length": 120 },
8+
"commands-show-output": false,
9+
"ol-prefix": { "style": "one" },
10+
"hr-style": { "style": "---" },
11+
"proper-names": {
12+
"names": [
13+
"CoffeeScript",
14+
"JavaScript"
15+
],
16+
"code_blocks": false
17+
}
18+
}

.npmignore

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,39 @@
1-
test/
2-
lib/*.js
1+
###
2+
### .npmignore
3+
###
4+
5+
## Git
6+
.gitignore
7+
8+
## GitHub
9+
.github/
10+
11+
## CI configuration files
12+
.codeclimate.yml
313
.travis.yml
14+
wercker.yml
15+
16+
## Build tool configuration files and intermediate storage
17+
.editorconfig
18+
.grunt/
19+
.markdownlint.json
420
Gruntfile.coffee
21+
coffeelint.json
22+
23+
## Node/npm
24+
.node_repl_history
25+
.npm/
26+
27+
## Coverage reports and instrumented source
28+
coverage/
29+
lib/*.js
30+
31+
## Test code and fixtures
32+
test/
33+
34+
## `npm pack` artifact
35+
abao-[0-9]*.[0-9]*.[0-9]*.tgz
36+
37+
# dotenv environment variables file
38+
.env
39+

.travis.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ node_js:
1212
- '6'
1313
- '4'
1414
env:
15-
- NODE_ENV=development
15+
- NODE_ENV=development
1616
notifications:
1717
slack:
1818
secure: fsCX0/TDE9TAJR0S91dboOZ4expmCc8o6joVzsHNJYTJfDtSJehdKjTzYuO/vsRigOOoQZ0dJEPl+D4fysBDV+jkOT5sTjp/uKtcfwHwPi03K8GauwvyW0x4N1M+mY+5jN2ZyBZXqVM5dc0wbgldP9QOg5UpB80hfWUZ+0F1MTM=
@@ -26,11 +26,18 @@ deploy:
2626
repo: cybertk/abao
2727
after_success:
2828
# - grunt coveralls:upload
29-
- BUILD_DIR="$HOME/build"
30-
- GITHUB_REPO="cybertk/abao"
31-
- PROJ_BUILD_DIR="$BUILD_DIR/$GITHUB_REPO"
32-
- PROJ_COVER_DIR="$PROJ_BUILD_DIR/coverage"
33-
- COVERAGE_FILE="$PROJ_COVER_DIR/coverage.lcov"
34-
- COVERALLS_BIN="./node_modules/coveralls/bin/coveralls.js"
29+
- COVERAGE_FILE="$TRAVIS_BUILD_DIR/coverage/coverage.lcov"
30+
- COVERALLS_BIN="./node_modules/.bin/coveralls"
3531
- $COVERALLS_BIN lib < $COVERAGE_FILE; echo "exit=$?"
32+
- echo
33+
- echo
34+
- echo "===== COMMIT ====="
35+
- echo "TRAVIS_REPO_SLUG=$TRAVIS_REPO_SLUG"
36+
- echo "TRAVIS_COMMIT=$TRAVIS_COMMIT"
37+
- echo "TRAVIS_COMMIT_MESSAGE=$TRAVIS_COMMIT_MESSAGE"
38+
- echo "TRAVIS_TAG=$TRAVIS_TAG"
39+
- echo "TRAVIS_BRANCH=$TRAVIS_BRANCH"
40+
- echo "===== BUILD ====="
41+
- echo "TRAVIS_BUILD_NUMBER=$TRAVIS_BUILD_NUMBER"
42+
- echo "TRAVIS_BUILD_DIR=$TRAVIS_BUILD_DIR"
3643

Gruntfile.coffee

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
module.exports = (grunt) ->
22

3+
'use strict'
34
require('time-grunt') grunt
45

56
# Dynamically load npm tasks
@@ -10,6 +11,7 @@ module.exports = (grunt) ->
1011
# Load in the module information
1112
pkg: grunt.file.readJSON 'package.json'
1213

14+
readme: 'README.md'
1315
gruntfile: 'Gruntfile.coffee'
1416

1517
clean:
@@ -42,15 +44,23 @@ module.exports = (grunt) ->
4244
]
4345

4446
coffeelint:
47+
options:
48+
configFile: 'coffeelint.json'
4549
default:
4650
src: [
4751
'lib/*.coffee'
4852
'test/**/*.coffee'
4953
]
5054
gruntfile:
5155
src: '<%= gruntfile %>'
56+
57+
markdownlint:
5258
options:
53-
configFile: 'coffeelint.json'
59+
config: require './.markdownlint.json'
60+
default:
61+
src: [
62+
'<%= readme %>'
63+
]
5464

5565
coffeecov:
5666
transpile:
@@ -84,7 +94,10 @@ module.exports = (grunt) ->
8494
]
8595

8696
grunt.registerTask 'instrument', [ 'coffeecov' ]
87-
grunt.registerTask 'lint', [ 'coffeelint' ]
97+
grunt.registerTask 'lint', [
98+
'coffeelint',
99+
'markdownlint'
100+
]
88101

89102
grunt.registerTask 'test', [
90103
'lint'

README.md

Lines changed: 39 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
Automated testing tool based on RAML-0.8
2-
31
# Abao
42

3+
RAML-based automated testing tool
4+
55
[![Build Status][Travis-Abao-badge]][Travis-Abao]
6-
[![Dependency Status][David-AbaoDep-badge]][David-AbaoDep]
7-
[![devDependency Status][David-AbaoDevDep-badge]][David-AbaoDevDep]
6+
[![Dependency Status][DavidDM-AbaoDep-badge]][DavidDM-AbaoDep]
7+
[![devDependency Status][DavidDM-AbaoDevDep-badge]][DavidDM-AbaoDevDep]
88
[![Coverage Status][Coveralls-Abao-badge]][Coveralls-Abao]
99
[![Gitter][Gitter-Abao-badge]][Gitter-Abao]
1010
[![CII Best Practices][BestPractices-Abao-badge]][BestPractices-Abao]
@@ -20,13 +20,13 @@ is valid or not.
2020

2121
## Features
2222

23-
- Verify that each endpoint defined in RAML exists in service
24-
- Verify that URL params for each endpoint defined in RAML are supported in service
25-
- Verify that the required query parameters defined in RAML are supported in service
26-
- Verify that HTTP request headers for each endpoint defined in RAML are supported in service
27-
- Verify that HTTP request body for each endpoint defined in RAML is supported in service, via [JSONSchema][] validation
28-
- Verify that HTTP response headers for each endpoint defined in RAML are supported in service
29-
- Verify that HTTP response body for each endpoint defined in RAML is supported in service, via [JSONSchema][] validation
23+
* Verify that each endpoint defined in RAML exists in service
24+
* Verify that URL params for each endpoint defined in RAML are supported in service
25+
* Verify that the required query parameters defined in RAML are supported in service
26+
* Verify that HTTP request headers for each endpoint defined in RAML are supported in service
27+
* Verify that HTTP request body for each endpoint defined in RAML is supported in service, via [JSONSchema][] validation
28+
* Verify that HTTP response headers for each endpoint defined in RAML are supported in service
29+
* Verify that HTTP response body for each endpoint defined in RAML is supported in service, via [JSONSchema][] validation
3030

3131
## RAML Support
3232

@@ -93,12 +93,12 @@ the RAML. You can print a list of the generated names with the `--names` flag.
9393

9494
### Example
9595

96-
The RAML file used in the examples below can be found [here](../master/test/fixtures/single-get.raml).
96+
The RAML file used in the examples below can be found [here](../master/test/fixtures/machines-single_get.raml).
9797

9898
Get Names:
9999

100100
```bash
101-
$ abao single-get.raml --names
101+
$ abao machines-single_get.raml --names
102102
GET /machines -> 200
103103
```
104104

@@ -108,7 +108,7 @@ response code for each path.
108108
```bash
109109
$ ABAO_HOME="/path/to/node_modules/abao"
110110
$ TEMPLATE="${ABAO_HOME}/templates/hookfile.js"
111-
$ abao single-get.raml --generate-hooks --template="${TEMPLATE}" > test_machines_hooks.js
111+
$ abao machines-single_get.raml --generate-hooks --template="${TEMPLATE}" > test_machines_hooks.js
112112

113113
```
114114

@@ -155,7 +155,7 @@ after 'GET /machines -> 200', (test, done) ->
155155
Run validation with *JavaScript* hookfile (from above):
156156

157157
```bash
158-
$ abao single-get.raml --hookfiles=test_machines_hooks.js
158+
$ abao machines-single_get.raml --hookfiles=test_machines_hooks.js
159159
```
160160

161161
You can also specify what tests **Abao** should skip:
@@ -208,24 +208,27 @@ test 'GET /machines -> 200', (response, body, done) ->
208208

209209
### test.request
210210

211-
- `server` - Server address, provided from command line.
212-
- `path` - API endpoint path, parsed from RAML.
213-
- `method` - HTTP method, parsed from RAML request method (e.g., `get`).
214-
- `params` - URI parameters, parsed from RAML request `uriParameters` [default: `{}`].
215-
- `query` - Object containing querystring values to be appended to the `path`,parsed from RAML `queryParameters` section [default: `{}`].
216-
- `headers` - HTTP headers, parsed from RAML `headers` [default: `{}`].
217-
- `body` - Entity body for POST, PUT, and PATCH requests. Must be a JSON-serializable object. Parsed from RAML `example` [default: `{}`].
211+
* `server` - Server address, provided by command line option or parsed from
212+
RAML `baseUri`.
213+
* `path` - API endpoint path, parsed from RAML.
214+
* `method` - HTTP method, parsed from RAML request method (e.g., `get`).
215+
* `params` - URI parameters, parsed from RAML request `uriParameters` [default: `{}`].
216+
* `query` - Object containing querystring values to be appended to the `path`.
217+
Parsed from RAML `queryParameters` section [default: `{}`].
218+
* `headers` - HTTP headers, parsed from RAML `headers` [default: `{}`].
219+
* `body` - Entity body for POST, PUT, and PATCH requests. Must be a
220+
JSON-serializable object. Parsed from RAML `example` [default: `{}`].
218221

219222
### test.response
220223

221-
- `status` - Expected HTTP response code, parsed from RAML response status.
222-
- `schema` - Expected schema of HTTP response body, parsed from RAML response `schema`.
223-
- `headers` - Object containing HTTP response headers from server [default: `{}`].
224-
- `body` - HTTP response body (JSON-format) from server [default: `null`].
224+
* `status` - Expected HTTP response code, parsed from RAML response status.
225+
* `schema` - Expected schema of HTTP response body, parsed from RAML response `schema`.
226+
* `headers` - Object containing HTTP response headers from server [default: `{}`].
227+
* `body` - HTTP response body (JSON-format) from server [default: `null`].
225228

226229
## Command Line Options
227230

228-
```
231+
```console
229232
Usage:
230233
abao </path/to/raml> [OPTIONS]
231234

@@ -273,6 +276,11 @@ $ npm test
273276
**Abao** is always looking for new ideas to make the codebase useful.
274277
If you think of something that would make life easier, please submit an issue.
275278

279+
```bash
280+
$ npm issues abao
281+
```
282+
283+
276284
[//]: # (Cross reference section)
277285

278286
[RAML]: https://raml.org/
@@ -285,10 +293,10 @@ If you think of something that would make life easier, please submit an issue.
285293

286294
[Travis-Abao]: https://travis-ci.org/cybertk/abao/
287295
[Travis-Abao-badge]: https://img.shields.io/travis/cybertk/abao.svg?style=flat
288-
[David-AbaoDep]: https://david-dm.org/cybertk/abao/
289-
[David-AbaoDep-badge]: https://david-dm.org/cybertk/abao/status.svg
290-
[David-AbaoDevDep]: https://david-dm.org/cybertk/abao?type=dev
291-
[David-AbaoDevDep-badge]: https://david-dm.org/cybertk/abao/dev-status.svg
296+
[DavidDM-AbaoDep]: https://david-dm.org/cybertk/abao/
297+
[DavidDM-AbaoDep-badge]: https://david-dm.org/cybertk/abao/status.svg
298+
[DavidDM-AbaoDevDep]: https://david-dm.org/cybertk/abao?type=dev
299+
[DavidDM-AbaoDevDep-badge]: https://david-dm.org/cybertk/abao/dev-status.svg
292300
[Coveralls-Abao]: https://coveralls.io/r/cybertk/abao/
293301
[Coveralls-Abao-badge]: https://img.shields.io/coveralls/cybertk/abao.svg
294302
[Gitter-Abao]: https://gitter.im/cybertk/abao/
@@ -298,4 +306,3 @@ If you think of something that would make life easier, please submit an issue.
298306
[NPM-Abao]: https://npmjs.org/package/abao/
299307
[NPM-Abao-badge]: https://nodei.co/npm/abao.png?downloads=true&downloadRank=true&stars=true
300308

301-

bin/abao

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,5 @@ var path = require('path');
1212
var fs = require('fs');
1313

1414
var libpath = path.join(path.dirname(fs.realpathSync(__filename)), '../lib');
15-
16-
require(libpath + '/cli');
15+
require(libpath + '/cli').main(process.argv.slice(2));
1716

0 commit comments

Comments
 (0)