Skip to content
This repository has been archived by the owner on Feb 1, 2023. It is now read-only.

Add integration test setup and examples folder #69

Merged
merged 3 commits into from
Oct 27, 2020
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ __pycache__
*.made
.venv
pip-wheel-metadata
coverage
.coverage
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ all: $(VENV)

clean:
find brick -name "*.pyc" -delete
-rm -rf .*.made build dist *.egg-info
-rm -rf .*.made build dist *.egg-info coverage


lint: $(VENV) .lint.made
Expand All @@ -33,7 +33,7 @@ format-check:


test: $(VENV)
$(VENV)/bin/py.test -lsvv tests
$(VENV)/bin/py.test -lsvv --cov-report html:coverage --cov=brick tests


verify: format lint test
Expand Down
1 change: 1 addition & 0 deletions examples/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.docker
Empty file added examples/WORKSPACE
Empty file.
2 changes: 2 additions & 0 deletions examples/brick_example_node/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
node_modules
*.log
17 changes: 17 additions & 0 deletions examples/brick_example_node/BUILD.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
steps:
prepare:
image: node:10.19.0-alpine
inputs:
- package.json
commands:
- yarn install

build:
commands:
- yarn test
- mkdir dist && node src/index.js > dist/out.txt
inputs:
- src
outputs:
- dist
tag: brick_example_node_prod:1.0
11 changes: 11 additions & 0 deletions examples/brick_example_node/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "node",
"version": "1.0.0",
"description": "",
"main": "src/index.js",
"scripts": {
"test": "echo testing"
},
"author": "",
"license": "ISC"
}
2 changes: 2 additions & 0 deletions examples/brick_example_node/src/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
//
console.log('hello from node.js')
4 changes: 4 additions & 0 deletions examples/brick_example_node/yarn.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


15 changes: 15 additions & 0 deletions examples/brick_example_python/BUILD.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
steps:
prepare:
image: python:3.7

build:
commands:
- mkdir dist && python src/index.py > dist/out.txt
inputs:
- src
- ../brick_example_node/dist/out.txt
outputs:
- dist

test:
command: echo "test"
9 changes: 9 additions & 0 deletions examples/brick_example_python/src/index.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import os

CURRENT_FOLDER = os.path.dirname(os.path.abspath(__file__))
NODE_OUT_TXT = os.path.join(CURRENT_FOLDER, "../../brick_example_node/dist/out.txt")

if __name__ == "__main__":
with open(NODE_OUT_TXT) as f:
print(f"{f.read().strip()} and Python")

4 changes: 4 additions & 0 deletions examples/brick_example_python/yarn.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


4 changes: 3 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,7 @@
"yamllint==1.17.0",
"wcmatch==6.0.1",
],
extras_require={"dev": ["black==19.10b0", "pylint==2.6.0", "pytest==6.0.1"]},
extras_require={
"dev": ["black==19.10b0", "pylint==2.6.0", "pytest==6.0.1", "pytest-cov==2.10.1"]
},
)
Loading