Skip to content

Commit

Permalink
Merge stable into release-1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasG0 committed Dec 9, 2024
2 parents 0c7f1d7 + 65aa5aa commit ae0dc1a
Show file tree
Hide file tree
Showing 488 changed files with 16,347 additions and 11,564 deletions.
176 changes: 113 additions & 63 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ jobs:
with:
submodules: true
- name: "Linting: markdownlint"
uses: DavidAnson/markdownlint-cli2-action@v17
uses: DavidAnson/markdownlint-cli2-action@v18
with:
config: .markdownlint.yaml
globs: |
Expand Down Expand Up @@ -312,8 +312,6 @@ jobs:
run: "poetry install --no-interaction --no-ansi"
- name: "Mypy Tests"
run: "poetry run invoke backend.mypy"
- name: "Pylint Tests"
run: "poetry run invoke backend.pylint"
- name: "Integration Tests"
run: "poetry run invoke backend.test-integration"
- name: "Coveralls : Integration Tests"
Expand All @@ -325,59 +323,106 @@ jobs:
flag-name: backend-integration
parallel: true

# ---------------------------------------------------
# DISABLING Memgraph for now :(
# - Tests where too flaky in 2.19 and completely broken in 2.20.1
# - Using new db session within tasks introduced flaky tests as well
# ---------------------------------------------------
# backend-tests-memgraph:
# if: |
# always() && !cancelled() &&
# !contains(needs.*.result, 'failure') &&
# !contains(needs.*.result, 'cancelled') &&
# needs.files-changed.outputs.backend == 'true'
# needs: ["files-changed", "yaml-lint", "python-lint"]
# runs-on:
# group: huge-runners
# timeout-minutes: 45
# strategy:
# fail-fast: false
# matrix:
# include:
# - name: backend-tests-unit-memgraph
# env:
# INFRAHUB_DB_TYPE: memgraph
# # - name: backend-tests-unit-nats
# # env:
# # INFRAHUB_DB_TYPE: memgraph
# # INFRAHUB_USE_NATS: 1
# # INFRAHUB_BROKER_DRIVER: nats
# # INFRAHUB_CACHE_DRIVER: nats
# name: ${{ matrix.name }}
# env: ${{ matrix.env }}
# steps:
# - name: "Check out repository code"
# uses: "actions/checkout@v4"
# with:
# submodules: true
# - name: Set up Python
# uses: actions/setup-python@v5
# with:
# python-version: '3.12'
# - name: "Setup git credentials"
# run: "git config --global user.name 'Infrahub' && \
# git config --global user.email '[email protected]' && \
# git config --global --add safe.directory '*' && \
# git config --global credential.usehttppath true && \
# git config --global credential.helper /usr/local/bin/infrahub-git-credential"
# - name: "Setup Python environment"
# run: |
# poetry config virtualenvs.create true --local
# poetry env use 3.12
# - name: "Install dependencies"
# run: "poetry install --no-interaction --no-ansi"
# - name: "Unit Tests"
# run: "poetry run invoke backend.test-unit"
backend-tests-functional:
if: |
always() && !cancelled() &&
!contains(needs.*.result, 'failure') &&
!contains(needs.*.result, 'cancelled') &&
needs.files-changed.outputs.backend == 'true'
needs: ["files-changed", "yaml-lint", "python-lint"]
runs-on:
group: "huge-runners"
timeout-minutes: 30
env:
INFRAHUB_DB_TYPE: neo4j
steps:
- name: "Check out repository code"
uses: "actions/checkout@v4"
with:
submodules: true
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: "Setup git credentials"
run: "git config --global user.name 'Infrahub' && \
git config --global user.email '[email protected]' && \
git config --global --add safe.directory '*' && \
git config --global credential.usehttppath true && \
git config --global credential.helper /usr/local/bin/infrahub-git-credential"
- name: "Setup Python environment"
run: |
poetry config virtualenvs.create true --local
poetry env use 3.12
- name: "Install dependencies"
run: "poetry install --no-interaction --no-ansi"
- name: "Mypy Tests"
run: "poetry run invoke backend.mypy"
- name: "Pylint Tests"
run: "poetry run invoke backend.pylint"
- name: "Functional Tests"
run: "poetry run invoke backend.test-functional"
- name: "Coveralls : Functional Tests"
uses: coverallsapp/github-action@v2
continue-on-error: true
env:
COVERALLS_SERVICE_NUMBER: ${{ github.sha }}
with:
flag-name: backend-functional
parallel: true

# ---------------------------------------------------
# DISABLING Memgraph for now :(
# Tests where too flaky in 2.19 and completely broken in 2.20.1
# ---------------------------------------------------
# backend-tests-memgraph:
# if: |
# always() && !cancelled() &&
# !contains(needs.*.result, 'failure') &&
# !contains(needs.*.result, 'cancelled') &&
# needs.files-changed.outputs.backend == 'true'
# needs: ["files-changed", "yaml-lint", "python-lint"]
# runs-on:
# group: huge-runners
# timeout-minutes: 45
# strategy:
# fail-fast: false
# matrix:
# include:
# - name: backend-tests-unit-memgraph
# env:
# INFRAHUB_DB_TYPE: memgraph
# # - name: backend-tests-unit-nats
# # env:
# # INFRAHUB_DB_TYPE: memgraph
# # INFRAHUB_USE_NATS: 1
# # INFRAHUB_BROKER_DRIVER: nats
# # INFRAHUB_CACHE_DRIVER: nats
# name: ${{ matrix.name }}
# env: ${{ matrix.env }}
# steps:
# - name: "Check out repository code"
# uses: "actions/checkout@v4"
# with:
# submodules: true
# - name: Set up Python
# uses: actions/setup-python@v5
# with:
# python-version: '3.12'
# - name: "Setup git credentials"
# run: "git config --global user.name 'Infrahub' && \
# git config --global user.email '[email protected]' && \
# git config --global --add safe.directory '*' && \
# git config --global credential.usehttppath true && \
# git config --global credential.helper /usr/local/bin/infrahub-git-credential"
# - name: "Setup Python environment"
# run: |
# poetry config virtualenvs.create true --local
# poetry env use 3.12
# - name: "Install dependencies"
# run: "poetry install --no-interaction --no-ansi"
# - name: "Unit Tests"
# run: "poetry run invoke backend.test-unit"

backend-validate-generated:
if: |
Expand Down Expand Up @@ -506,12 +551,17 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: "Setup Python environment"
run: |
pipx install poetry
poetry config virtualenvs.create true --local
poetry env use 3.12
- name: "Install dependencies"
run: "poetry install --no-interaction --no-ansi"
- name: "Setup environment"
run: "pip install invoke toml"
- name: "Build Test Image"
run: "invoke dev.build"
- name: "Validate generated documentation"
run: "invoke docs.validate --docker"
run: "poetry run invoke docs.validate"

validate-documentation-style:
if: |
Expand Down Expand Up @@ -657,9 +707,9 @@ jobs:

- name: Add response delay if required
if: needs.files-changed.outputs.e2e_tests == 'true'
run: echo "INFRAHUB_MISC_RESPONSE_DELAY=2" >> $GITHUB_ENV && invoke dev.start
run: echo "INFRAHUB_MISC_RESPONSE_DELAY=1" >> $GITHUB_ENV && invoke dev.start
env:
INFRAHUB_MISC_RESPONSE_DELAY: 2
INFRAHUB_MISC_RESPONSE_DELAY: 1

- name: Set infrahub address
if: needs.files-changed.outputs.e2e_tests == 'true'
Expand Down Expand Up @@ -781,11 +831,11 @@ jobs:

- name: Display task worker 1 logs
if: always()
run: docker logs "${INFRAHUB_BUILD_NAME}-infrahub-git-1"
run: docker logs "${INFRAHUB_BUILD_NAME}-task-worker-1"

- name: Display task worker 2 logs
if: always()
run: docker logs "${INFRAHUB_BUILD_NAME}-infrahub-git-2"
run: docker logs "${INFRAHUB_BUILD_NAME}-task-worker-2"

- name: Display task manager logs
if: always()
Expand Down
Loading

0 comments on commit ae0dc1a

Please sign in to comment.