Skip to content

Commit cdabbf0

Browse files
committed
First Release
1 parent 4009f03 commit cdabbf0

File tree

406 files changed

+35953
-0
lines changed

Some content is hidden

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

406 files changed

+35953
-0
lines changed

.coveragerc

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[run]
2+
omit = */app/tests/*

.devcontainer/devcontainer.json

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the README at:
2+
// https://github.com/microsoft/vscode-dev-containers/tree/v0.140.1/containers/docker-existing-docker-compose
3+
// If you want to run as a non-root user in the container, see .devcontainer/docker-compose.yml.
4+
{
5+
"name": "Backend: CHIP Test Harness",
6+
"initializeCommand": "bash .devcontainer/initializeCommands.sh", // required to get the environment variables set for the sub-folder backend
7+
"dockerComposeFile": [
8+
"../docker-compose.yml",
9+
"../docker-compose.override.yml",
10+
"docker-compose.yml"
11+
],
12+
// The 'service' property is the name of the service for the container that VS Code should
13+
// use. Update this value and .devcontainer/docker-compose.yml to the real service name.
14+
"service": "backend",
15+
// The optional 'workspaceFolder' property is the path VS Code should open by default when
16+
// connected. This is typically a file mount in .devcontainer/docker-compose.yml
17+
"workspaceFolder": "/app",
18+
// Set *default* container specific settings.json values on container create.
19+
"customizations": {
20+
"vscode": {
21+
"settings": {
22+
"python.pythonPath": "/usr/local/bin/python",
23+
"python.formatting.blackPath": "/usr/local/bin/black",
24+
"python.linting.flake8Path": "/usr/local/bin/flake8",
25+
"python.testing.pytestPath": "/usr/local/bin/pytest",
26+
"isort.path": [
27+
"/usr/local/bin/isort"
28+
]
29+
},
30+
// Add the IDs of extensions you want installed when the container is created.
31+
"extensions": [
32+
"ms-python.python",
33+
"ms-python.isort",
34+
"ms-python.flake8",
35+
"ms-python.black-formatter",
36+
"streetsidesoftware.code-spell-checker",
37+
"ms-azuretools.vscode-docker",
38+
"asciidoctor.asciidoctor-vscode",
39+
"42crunch.vscode-openapi",
40+
"matangover.mypy",
41+
"njpwerner.autodocstring"
42+
]
43+
}
44+
}
45+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
46+
// "forwardPorts": [],
47+
// Uncomment the next line if you want start specific services in your Docker Compose config.
48+
// "runServices": [],
49+
// Uncomment the next line if you want to keep your containers running after VS Code shuts down.
50+
// "shutdownAction": "none",
51+
// Uncomment the next line to run commands after the container is created - for example installing curl.
52+
// "postCreateCommand": "apt-get update && apt-get install -y curl",
53+
// Uncomment to connect as a non-root user if you've added one. See https://aka.ms/vscode-remote/containers/non-root.
54+
// "remoteUser": "vscode"
55+
}

.devcontainer/docker-compose.yml

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
version: "3.3"
2+
services:
3+
backend:
4+
command: bash -c "while true; do sleep 1; done" # Infinite loop to keep container live doing nothing

.devcontainer/initializeCommands.sh

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
# cp ../.env . # required to get the environment variables set for the sub-folder backend

.env

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
DOMAIN=localhost
2+
# DOMAIN=local.dockertoolbox.tiangolo.com
3+
# DOMAIN=localhost.tiangolo.com
4+
# DOMAIN=dev.chip-test-harness.com
5+
6+
STACK_NAME=chip-test-harness
7+
8+
TRAEFIK_PUBLIC_NETWORK=traefik-public
9+
TRAEFIK_TAG=chip-test-harness.com
10+
TRAEFIK_PUBLIC_TAG=traefik-public
11+
12+
DOCKER_IMAGE_BACKEND=backend
13+
14+
# Backend
15+
BACKEND_CORS_ORIGINS=["http://localhost", "http://localhost:4200", "http://localhost:3000", "http://localhost:8080", "https://localhost", "https://localhost:4200", "https://localhost:3000", "https://localhost:8080", "http://dev.chip-test-harness.com", "https://stag.chip-test-harness.com", "https://chip-test-harness.com", "http://local.dockertoolbox.tiangolo.com", "http://localhost.tiangolo.com"]
16+
PROJECT_NAME=CHIP Test Harness
17+
SECRET_KEY=790dd0ee330f50075404bdb3870273b03bf17347f3f256328fc38afaad28dd64
18+
SMTP_TLS=True
19+
SMTP_PORT=587
20+
SMTP_HOST=
21+
SMTP_USER=
22+
SMTP_PASSWORD=
23+
EMAILS_FROM_EMAIL=info@chip-test-harness.com
24+
25+
# Postgres
26+
POSTGRES_SERVER=db
27+
POSTGRES_USER=postgres
28+
POSTGRES_PASSWORD=b461a2eee00db1934aa87d74d218a8a35eb9fbba09fd7c3f85dccc067b65d11e
29+
POSTGRES_DB=app

.flake8

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[flake8]
2+
max-line-length = 88
3+
extend-ignore = E203, W503
4+
exclude = .git,__pycache__,__init__.py,.mypy_cache,.pytest_cache,third_party,test_collections/yaml_tests/yaml/sdk,test_collections/yaml_tests/sdk_runner
5+
; Ignore max-line-length in autogenerated files
6+
per-file-ignores =
7+
test_collections/automated_and_semi_automated/**/*:E501
8+
test_collections/manual_tests/**/*:E501,W291
9+
test_collections/app1_tests/**/*:E501
10+
test_collections/semi_automated_tests/**/*:E501

.gitattributes

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# used to remove files from deployment using `git archive`
2+
# git files
3+
.gitattributes export-ignore
4+
.gitignore export-ignore
5+
6+
# SDK repo
7+
third_party export-ignore
8+
9+
# other dot folders and files
10+
.devcontainer export-ignore
11+
.github export-ignore
12+
.mypy_cache export-ignore
13+
.pytest_cache export-ignore
14+
.vscode export-ignore
15+
.logs export-ignore
16+
.coverage export-ignore
17+
.coveragerc export-ignore
18+
.dockerignore export-ignore
19+
.pullaprove.yml export-ignore
+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
name: "\U0001F41B Bug report"
2+
description: Create a report to help us improve
3+
title: "[Bug] "
4+
body:
5+
- type: textarea
6+
id: bug-description
7+
attributes:
8+
label: Describe the bug
9+
description: A clear and concise description of what the bug is
10+
validations:
11+
required: true
12+
- type: textarea
13+
id: use-case
14+
attributes:
15+
label: Steps to reproduce the behavior
16+
description: Please describe how the bug can be reproduced
17+
placeholder: |
18+
1. Go to '...'
19+
2. Click on '....'
20+
3. Scroll down to '....'
21+
4. See error
22+
- type: textarea
23+
id: expected-behavior
24+
attributes:
25+
label: Expected behavior
26+
description: A clear and concise description of what you expected to happen
27+
validations:
28+
required: false
29+
- type: textarea
30+
id: logs
31+
attributes:
32+
label: Log files
33+
description: If applicable, please provide the log files related to this bug
34+
placeholder: |
35+
E.g.:
36+
- TH logs: ...
37+
- DUT logs: ...
38+
validations:
39+
required: false
40+
- type: textarea
41+
id: pics
42+
attributes:
43+
label: PICS file
44+
description: If applicable, please provide the PICS file that was used
45+
validations:
46+
required: false
47+
- type: textarea
48+
id: screenshot
49+
attributes:
50+
label: Screenshots
51+
description: If applicable, provide screenshots to help explain your problem
52+
validations:
53+
required: false
54+
- type: textarea
55+
id: environment
56+
attributes:
57+
label: Environment
58+
description: Please complete the following information and provide any other enviroment versions you believe that might be relevant
59+
placeholder: |
60+
- TH version: [e.g. v2.8.1]
61+
- OS: [e.g. ubuntu 22.0, macOS 13.0]
62+
- Browser: [e.g. chrome, safari]
63+
validations:
64+
required: false
65+
- type: textarea
66+
id: additional-info
67+
attributes:
68+
label: Additional Information
69+
description: Please include any other additional or relevant information here
70+
validations:
71+
required: false

.github/ISSUE_TEMPLATE/config.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
blank_issues_enabled: false
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: "\U0001F4A1 Feature Request"
2+
description: Create a feature to be considered in a future release
3+
title: "[Feature] "
4+
body:
5+
- type: textarea
6+
id: repro
7+
attributes:
8+
label: Feature description
9+
description: Please provide as much context and details as possible
10+
validations:
11+
required: true
12+
- type: textarea
13+
id: use-case
14+
attributes:
15+
label: Use Cases
16+
description: Please provide some use cases for the feature
17+
placeholder: |
18+
E.g.:
19+
[Use Case 1] Export a test run execution:
20+
1. Use the backend endpoint to export a test run execution: ...
21+
2. Then import the exported execution using this endpoint: ...
22+
validations:
23+
required: true
24+
- type: textarea
25+
id: test-case
26+
attributes:
27+
label: Test Cases
28+
description: Please provide some test cases to be used to validate feature behaves as expected.
29+
placeholder: |
30+
E.g.:
31+
[Test Case 1] Test Use Case 1: Test the export a test run execution
32+
1. Use the backend endpoint to export a test run execution: ...
33+
Expected Result: The endpoind should return a JSON containing the data for a test run execution following the format bellow:
34+
{"db_revision": "9996326cbd1d","test_run_execution": {"title": "UI_Test_Run_2023_05_23_18_43_30"...
35+
validations:
36+
required: false
37+
- type: textarea
38+
attributes:
39+
label: Additional Information
40+
description: Please include any other additional or relevant information here
41+
validations:
42+
required: false

.github/workflows/python-lint.yml

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Python Linting
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- develop
7+
- "release/**"
8+
push:
9+
branches:
10+
- develop
11+
- "release/**"
12+
13+
jobs:
14+
run-linters:
15+
name: Run linters
16+
runs-on: ubuntu-22.04
17+
18+
steps:
19+
- name: Check out Git repository
20+
uses: actions/checkout@v3
21+
22+
- name: Set up Python
23+
uses: actions/setup-python@v1
24+
with:
25+
python-version: "3.10"
26+
27+
- name: Install Python dependencies
28+
run: >
29+
pip install
30+
poetry==1.5.0
31+
black==23.7.0
32+
flake8==6.0.0
33+
mypy==1.3.0
34+
isort==5.12.0
35+
sql==2022.4.0
36+
pydantic==1.10.11
37+
pydantic-yaml==0.11.2
38+
types-requests==2.31.0.1
39+
types-filelock==3.2.7
40+
types-pyyaml==6.0.12.10
41+
types-retry==0.9.9.4
42+
- name: Run linters
43+
uses: wearerequired/lint-action@v1
44+
with:
45+
github_token: ${{ secrets.github_token }}
46+
# Enable linters
47+
black: true
48+
flake8: true
49+
mypy: true
50+
mypy_args: "app test_collections"
51+
52+
- name: Run isort
53+
run: isort --check-only app test_collections

.github/workflows/spell-check.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: "Check spelling"
2+
on: # rebuild any PRs and main branch changes
3+
pull_request:
4+
branches:
5+
- develop
6+
push:
7+
branches:
8+
- develop
9+
jobs:
10+
spellcheck: # run the action
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- uses: streetsidesoftware/cspell-action@v2
15+
with:
16+
incremental_files_only: false

0 commit comments

Comments
 (0)