Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:NREL/alfalfa into openstudio_38
Browse files Browse the repository at this point in the history
  • Loading branch information
TShapinsky committed May 15, 2024
2 parents a71eeed + 982235d commit 6e95590
Show file tree
Hide file tree
Showing 5 changed files with 33 additions and 43 deletions.
56 changes: 28 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.8"

- name: Run pre-commit
uses: pre-commit/[email protected].0
uses: pre-commit/[email protected].1
with:
extra_args: --all-files

Expand All @@ -34,15 +34,15 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.8"

- name: Install poetry
uses: abatilo/actions-poetry@v2.0.0
uses: abatilo/actions-poetry@v3
with:
poetry-version: 1.8.3

Expand Down Expand Up @@ -70,13 +70,13 @@ jobs:
timeout-minutes: 30
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Build
uses: docker/bake-action@v2
uses: docker/bake-action@v4
with:
files: docker-compose.yml, docker-compose.dev.yml
set: |
Expand All @@ -95,7 +95,7 @@ jobs:
docker compose -f docker-compose.yml -f docker-compose.dev.yml up -d worker mongo redis minio mc goaws
- name: Dump docker logs before tests
uses: jwalton/gh-docker-logs@v1
uses: jwalton/gh-docker-logs@v2

- name: Run job tests in Docker worker container
run: |
Expand All @@ -104,31 +104,31 @@ jobs:
- name: Dump docker logs on failure
if: failure()
uses: jwalton/gh-docker-logs@v1
uses: jwalton/gh-docker-logs@v2

integration-tests:
name: Run integration tests
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.8"

- name: Install poetry
uses: abatilo/actions-poetry@v2.0.0
uses: abatilo/actions-poetry@v3
with:
poetry-version: 1.8.3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Build
uses: docker/bake-action@v2
uses: docker/bake-action@v4
with:
files: docker-compose.yml
set: |
Expand All @@ -153,7 +153,7 @@ jobs:
interval: 500

- name: Dump docker logs before tests
uses: jwalton/gh-docker-logs@v1
uses: jwalton/gh-docker-logs@v2

- name: Install dependencies
run: poetry install
Expand All @@ -172,31 +172,31 @@ jobs:
- name: Dump docker logs on failure
if: failure()
uses: jwalton/gh-docker-logs@v1
uses: jwalton/gh-docker-logs@v2

integration-tests-historian:
name: Run integration tests with historian
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Install Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.8"

- name: Install poetry
uses: abatilo/actions-poetry@v2.0.0
uses: abatilo/actions-poetry@v3
with:
poetry-version: 1.8.3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Build
uses: docker/bake-action@v2
uses: docker/bake-action@v4
with:
load: true
files: docker-compose.yml, docker-compose.dev.yml, docker-compose.historian.yml
Expand Down Expand Up @@ -225,7 +225,7 @@ jobs:
interval: 500

- name: Dump docker logs before tests
uses: jwalton/gh-docker-logs@v1
uses: jwalton/gh-docker-logs@v2

- name: Install dependencies
run: poetry install
Expand All @@ -244,14 +244,14 @@ jobs:
- name: Dump docker logs on failure
if: failure()
uses: jwalton/gh-docker-logs@v1
uses: jwalton/gh-docker-logs@v2

publish:
needs: [pre-commit, unit-tests, simulation-tests, integration-tests, integration-tests-historian]
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Log into container registry
uses: docker/login-action@v2
Expand All @@ -261,7 +261,7 @@ jobs:
password: ${{ secrets.GITHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3

- name: Docker meta
uses: docker/metadata-action@v4
Expand All @@ -278,7 +278,7 @@ jobs:
type=semver,pattern={{major}},enable=${{ github.event_name == 'release' }}
- name: Build
uses: docker/bake-action@v2
uses: docker/bake-action@v4
with:
files: |
docker-compose.yml
Expand Down
11 changes: 0 additions & 11 deletions alfalfa_worker/__init__.py

This file was deleted.

2 changes: 1 addition & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ markers =
fmu: mark tests that require fmu support, e.g., pyfmi (deselect with '-m "not fmu"')
docker: mark tests that must be run within docker
scale: mark tests that must ben run with multiple workers (deselect with '-m "not scale"')
api: mark tests specific to the API compliance
norecursedirs =
dist
build
Expand Down
6 changes: 3 additions & 3 deletions tests/worker/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@


class TestModelsObjects:
def setup(self):
def setup_method(self):
"""Create the connection to the mongodatabase since we are not loading the entire framework.
Note that the config params are monkeypatched in the conftest file"""
connect(host=f"{os.environ['MONGO_URL']}/{os.environ['MONGO_DB_NAME']}", uuidrepresentation='standard')
Expand All @@ -39,7 +39,7 @@ def test_create_and_destroy_site(self):

class TestModelObjectsWithFixtures():

def setup(self):
def setup_method(self):
"""Create the connection to the mongodatabase since we are not loading the entire framework.
Note that the config params are monkeypatched in the conftest file"""
connect(host=f"{os.environ['MONGO_URL']}/{os.environ['MONGO_DB_NAME']}", uuidrepresentation='standard')
Expand Down Expand Up @@ -67,7 +67,7 @@ def setup(self):

# TODO: grab the model object from the database and attach

def teardown(self):
def teardown_method(self):
"""Remove all the data that was generated during this test"""
for datum in site_data:
site = Site.objects(ref_id=datum['ref_id']).first()
Expand Down

0 comments on commit 6e95590

Please sign in to comment.