-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
108 changed files
with
4,228 additions
and
3,365 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,5 @@ dist | |
**/__pycache__ | ||
.git | ||
.idea | ||
.venv | ||
venv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
name: e2e tests on demand | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
edaqa_ref: | ||
description: 'ref of the eda-qa repository, default is main' | ||
required: false | ||
default: 'main' | ||
pull_request_target: | ||
types: | ||
- labeled | ||
- synchronize | ||
|
||
env: | ||
EDA_QA_PATH: "./eda-qa" | ||
REGISTRY: quay.io | ||
QUAY_USER: ansible+eda_gha | ||
|
||
jobs: | ||
api-e2e-tests: | ||
if: > | ||
(github.repository == 'ansible/eda-server' && github.event_name == 'workflow_dispatch') || | ||
(github.repository == 'ansible/eda-server' && github.event_name == 'pull_request_target' && | ||
contains(github.event.pull_request.labels.*.name, 'run-e2e')) | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ env.QUAY_USER }} | ||
password: ${{ secrets.QUAY_PASSWORD }} | ||
|
||
- name: Run api in background | ||
working-directory: tools/docker | ||
env: | ||
DJANGO_SETTINGS_MODULE: aap_eda.settings.default | ||
EDA_DEBUG: "false" | ||
run: | | ||
docker-compose -p eda -f docker-compose-dev.yaml build | ||
docker-compose -p eda -f docker-compose-dev.yaml up -d | ||
while ! curl -s http://localhost:8000/_healthz | grep -q "OK"; do | ||
echo "Waiting for API to be ready..." | ||
sleep 1 | ||
done | ||
- name: Fetch test suite | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
repository: ansible/eda-qa | ||
ref: ${{ github.event.inputs.edaqa_ref }} | ||
path: ${{ env.EDA_QA_PATH }} | ||
token: ${{ secrets.EDA_QA_GITHUB_TOKEN }} | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.9" | ||
|
||
- name: Install dependencies | ||
working-directory: ${{ env.EDA_QA_PATH }} | ||
run: pip install . | ||
|
||
- name: Run tests | ||
working-directory: ${{ env.EDA_QA_PATH }} | ||
env: | ||
EDAQA_FERNET_PASSWORD: ${{ secrets.EDAQA_FERNET_PASSWORD }} | ||
EDAQA_ENV: authenticated | ||
run: pytest | ||
|
||
- name: Print EDA logs | ||
if: always() | ||
working-directory: tools/docker | ||
run: | | ||
docker-compose -p eda -f docker-compose-dev.yaml logs | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,11 +27,11 @@ If you are proposing a feature: | |
Before you submit a pull request, check that it meets these guidelines: | ||
|
||
1. The pull request should include tests. | ||
2. The pull request should work for Python 3.9 | ||
2. The pull request should work for Python 3.11 | ||
3. The pull request should pass all tests, linters and CI checks. You can run | ||
each of these locally in your [development environment](docs/development.md) | ||
|
||
## Contact | ||
|
||
Also you can check the [Matrix chat](https://matrix.to/#/#eda:ansible.com), or via the | ||
[email protected] email. | ||
<[email protected]> email. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ | |
|
||
For running services locally: | ||
|
||
* Python >= 3.9 | ||
* Python >= 3.11 | ||
|
||
For standalone development tools written in Python, such as `pre-commit`, | ||
we recommend using your system package manager, | ||
|
@@ -86,7 +86,7 @@ systemctl --user enable --now podman.socket | |
On Linux and macOS, Poetry can be installed with the official installer: | ||
|
||
```shell | ||
curl -sSL https://install.python-poetry.org | python3 - | ||
curl -sSL https://install.python-poetry.org | python3.11 - | ||
``` | ||
|
||
Alternatively, you can install it with manually with `pip` or `pipx`: | ||
|
@@ -100,7 +100,7 @@ pipx install poetry | |
In ArchLinux, Poetry is available in the official distribution repositories: | ||
|
||
```shell | ||
sudo pacman -S python-poetry | ||
sudo pacman -S python-poetry | ||
``` | ||
|
||
In macOS, Poetry can be installed with Homebrew: | ||
|
@@ -157,12 +157,12 @@ git clone [email protected]:ansible/eda-server.git | |
|
||
### Install dependencies | ||
|
||
**NOTE**: Since we added experimental [LDAP authentication](https://github.com/ansible/eda-server/pull/557), the following additional packages are required: `openldap-devel xmlsec1-devel libtool-ltdl-devel`. | ||
**NOTE**: Since we added experimental [LDAP authentication](https://github.com/ansible/eda-server/pull/557), the following additional packages are required: `openldap-devel xmlsec1-devel libtool-ltdl-devel`. | ||
|
||
Go to your project directory and install dependencies for local development: | ||
|
||
```shell | ||
task dev:init | ||
task dev:init | ||
``` | ||
|
||
Or if you want to customize installation options, you may run commands, executed by the `dev:init` | ||
|
@@ -188,6 +188,7 @@ $ docker images | |
REPOSITORY TAG IMAGE ID CREATED SIZE | ||
localhost/aap-eda latest 28fd94c8cf89 5 hours ago 611MB | ||
``` | ||
|
||
To override image name:(using short git hash for version here) | ||
|
||
```shell | ||
|
@@ -249,20 +250,21 @@ task manage -- migrate | |
With docker compose: | ||
|
||
```shell | ||
task docker:migrate | ||
task docker:migrate | ||
``` | ||
|
||
### Seeding the database | ||
|
||
Locally: | ||
|
||
```shell | ||
task manage -- create_initial_data | ||
``` | ||
|
||
With docker compose: | ||
|
||
``` | ||
task docker -- run api --rm aap-eda-manage create_initial_data | ||
```shell | ||
task docker -- run --rm eda-api aap-eda-manage create_initial_data | ||
``` | ||
|
||
### Create superuser | ||
|
@@ -287,7 +289,7 @@ by running `task run:scheduler` | |
With docker compose: | ||
|
||
```shell | ||
task docker -- up -d api | ||
task docker -- up -d eda-api | ||
``` | ||
|
||
### Running tests | ||
|
@@ -296,26 +298,26 @@ To run tests locally, you need to have a running instance of postgresql and redi | |
|
||
Run all tests: | ||
|
||
``` | ||
```shell | ||
task test | ||
``` | ||
|
||
Run a single module: | ||
|
||
``` | ||
```shell | ||
task test -- tests/integration/api/test_activation.py | ||
``` | ||
|
||
Run a single test: | ||
|
||
``` | ||
```shell | ||
task test -- tests/integration/api/test_activation.py::test_retrieve_activation | ||
``` | ||
|
||
With docker compose: | ||
|
||
```shell | ||
task docker -- run api --rm python -m pytest | ||
```shell | ||
task docker -- run --rm eda-api python3.11 -m pytest | ||
``` | ||
|
||
### Running linters | ||
|
@@ -354,3 +356,5 @@ You can run individual formatting tools if needed: | |
task format:isort | ||
task format:black | ||
``` | ||
|
||
You can now access the UI at <https://localhost:8443/eda/> with default login username and password(admin/testpass). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.