Skip to content

Commit 3692dd7

Browse files
authored
Merge pull request #603 from MetaCell/release/2.0.0
Release/2.0.0
2 parents 3a84d5e + e8d95f9 commit 3692dd7

767 files changed

Lines changed: 59669 additions & 7451 deletions

File tree

Some content is hidden

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

.dockerignore

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
**/node_modules
22
.tox
33
docs
4-
applications
5-
infrastructure
6-
blueprint
4+
/applications
5+
/infrastructure
6+
/blueprint
77
test
88
.github
99
.git
10-
.vscode
10+
.vscode
11+
/deployment
12+
skaffold.yaml

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,14 @@ node_modules
66
.vscode
77
.coverage
88
*.DS_Store
9-
deployment
9+
deployment/helm
1010
*.egg-info
1111
*.idea
1212
/build
1313
skaffold.yaml
1414
.tox
1515
.pytest_cache
16-
.overrides
16+
.overrides
17+
deployment.yaml
18+
.hypothesis
19+
__pycache__

README.md

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ What building your cloud solution with CloudHarness gives to you:
1717
- access gatekeepers configuration
1818
- secrets
1919
- templated config maps from files
20-
- secrets
2120
* Automatic build and push of images
2221
* REST-API scaffolding building based on OpenApi
2322
* Continuous deployment script generation
@@ -28,7 +27,12 @@ What building your cloud solution with CloudHarness gives to you:
2827
* Submit batch and asynchronous workflows - based on Argo
2928
* Orchestrate microservices - based on Kafka
3029
* Assign compute workspaces to users - based Jupyterhub
31-
30+
* Testing framework to help you write and run tests
31+
* Unit tests
32+
* API integration tests
33+
* End to End tests (with Puppeteer)
34+
* CI/CD pipelines generation
35+
3236
# Why CloudHarness?
3337

3438
The microservice architecture is a great to get code separation and flexible development, but may not be of easy implementation, especially for small development teams/projects.
@@ -52,7 +56,7 @@ CloudHarness provides the following command line tools to help application scaff
5256
* `harness-deployment` - generate the helm chart to deploy on Kubernetes.
5357
* `harness-application` - create a new CloudHarness REST application.
5458
* `harness-generate` - generates server and client code for all CloudHarness REST applications.
55-
59+
* `harness-test` - run end to end tests
5660
# Get started
5761

5862
## Prerequisites
@@ -66,14 +70,14 @@ Cloudharness can be used on all major operative systems.
6670
- Windows native: mostly working, unsupported
6771

6872
### Python
69-
Python 3.7-3.9 must be installed.
73+
Python 3.9 must be installed.
7074

7175
It is recommended to setup a virtual environment.
7276
With conda:
73-
```bash
74-
conda create --name ch python=3.7
75-
conda activate ch
76-
```
77+
```bash
78+
conda create --name ch python=3.9
79+
conda activate ch
80+
```
7781

7882
### Docker
7983
[Docker](https://www.docker.com) is required to build locally.
@@ -90,11 +94,26 @@ With conda:
9094

9195
[Skaffold](https://skaffold.dev/docs/install/) is the way to go to build and debug your application in your local development environment.
9296

97+
### Node environment
98+
99+
A node environment with npm is required for developing web applications and to run end to end tests.
100+
101+
Recommended:
102+
- node >= v14.0.0
103+
- npm >= 8.0.0
104+
105+
### Java Runtime Environment
106+
107+
A JRE is needed to run the code generators based on openapi-generator.
108+
109+
For more info, see [here](https://openapi-generator.tech/docs/installation).
110+
111+
93112
## CloudHarness command line tools
94113
To use the cli tools, install requirements first:
95114

96115
```bash
97-
source install.sh
116+
bash install.sh
98117
```
99118
### Generate deployment
100119

@@ -141,7 +160,7 @@ harness-deployment cloud-harness . [PARAMS]
141160
```
142161

143162
to create the build and deployment artifacts for your solution.
144-
See the dedicated [Build and deploy](./docs/build-deploy-howto.md) document for more details and examples.
163+
See the dedicated [Build and deploy](./docs/build-deploy/README.md) document for more details and examples.
145164

146165
# Add and manage applications
147166

tools/cloudharness_utilities/application-templates/README.md renamed to application-templates/README.md

File renamed without changes.

tools/cloudharness_utilities/application-templates/base/api/config.json renamed to application-templates/base/api/config.json

File renamed without changes.

tools/cloudharness_utilities/application-templates/base/api/openapi.yaml renamed to application-templates/base/api/openapi.yaml

File renamed without changes.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
harness:
2+
users:
3+
- username: __APP_NAME__
4+
email: __APP_NAME__@testuser.com
5+
clientRoles: []
6+
realmRoles: []

tools/cloudharness_utilities/application-templates/base/deploy/values.yaml renamed to application-templates/base/deploy/values.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,10 @@ harness:
1414
dependencies:
1515
build:
1616
- cloudharness-base
17-
- cloudharness-flask
17+
- cloudharness-flask
18+
test:
19+
api:
20+
enabled: true
21+
autotest: true
22+
checks:
23+
- all
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import os
2+
from pprint import pprint
3+
import schemathesis as st
4+
from schemathesis.checks import response_schema_conformance, not_a_server_error
5+
6+
from cloudharness_test import apitest_init # include to perform default authorization
7+
8+
app_url = os.environ.get("APP_URL", "http://samples.ch.local/api")
9+
10+
schema = st.from_uri(app_url + "/openapi.json")
11+
12+
13+
@schema.parametrize(endpoint="/ping")
14+
def test_ping(case):
15+
response = case.call()
16+
pprint(response.__dict__)
17+
assert response.status_code == 200, "this api errors on purpose"
18+
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
import * as puppeteer from "puppeteer";
2+
3+
let page: any;
4+
let browser: any;
5+
6+
describe("End to end test", () => {
7+
beforeAll(async () => {
8+
browser = await puppeteer.launch({args: ['--no-sandbox'],});
9+
page = await browser.newPage();
10+
console.log(process.env.APP_URL)
11+
await page
12+
.goto(process.env.APP_URL, {
13+
waitUntil: "networkidle0",
14+
})
15+
// tslint:disable-next-line:no-empty
16+
.catch(() => {});
17+
});
18+
19+
afterAll(() => {
20+
if (!page.isClosed()) {
21+
browser.close();
22+
}
23+
});
24+
25+
// TODO CHANGEME
26+
test("should see the landing page", async () => {
27+
await page.waitForSelector("h1");
28+
const title = await page.$eval("h1", (el: { textContent: any }) => {
29+
return el.textContent;
30+
});
31+
32+
expect(await page.title()).toEqual("Samples");
33+
expect(title).toEqual("Sample React application is working!");
34+
});
35+
});

0 commit comments

Comments
 (0)