Skip to content

Commit

Permalink
Merge pull request nautobot#550 from nautobot/u/gas-fix-ltm-check-mig…
Browse files Browse the repository at this point in the history
…rations

fixed invoke check-migrations in ltm
  • Loading branch information
jdrew82 authored Sep 22, 2024
2 parents 622d506 + fafc85d commit ab7165a
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on: # yamllint disable-line rule:truthy rule:comments
pull_request: ~

env:
PLUGIN_NAME: "nautobot-plugin-ssot"
PLUGIN_NAME: "nautobot-ssot"

jobs:
black:
Expand Down
2 changes: 1 addition & 1 deletion development/docker-compose.mysql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ services:
db:
image: "mysql:8"
command:
- "--default-authentication-plugin=mysql_native_password"
- "--max_connections=1000"
env_file:
- "development.env"
- "creds.env"
Expand Down
24 changes: 19 additions & 5 deletions tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,19 @@
from invoke import Collection, task as invoke_task
import os

from dotenv import load_dotenv
try:
from dotenv import load_dotenv

HAS_DOTENV = True
except ImportError:
HAS_DOTENV = False


def _load_dotenv():
load_dotenv("./development/development.env")
load_dotenv("./development/creds.env")
"""Load environment variables from .env file."""
if HAS_DOTENV:
load_dotenv("./development/development.env")
load_dotenv("./development/creds.env")


def is_truthy(arg):
Expand Down Expand Up @@ -609,7 +616,7 @@ def yamllint(context):
@task
def check_migrations(context):
"""Check for missing migrations."""
command = "nautobot-server --config=nautobot/core/tests/nautobot_config.py makemigrations --dry-run --check"
command = "nautobot-server makemigrations --dry-run --check"

run_command(context, command)

Expand All @@ -623,7 +630,14 @@ def check_migrations(context):
"pattern": "Run specific test methods, classes, or modules instead of all tests",
}
)
def unittest(context, keepdb=False, label="nautobot_ssot", failfast=False, buffer=True, pattern=""):
def unittest(
context,
keepdb=False,
label="nautobot_ssot",
failfast=False,
buffer=True,
pattern="",
):
"""Run Nautobot unit tests."""
command = f"coverage run --module nautobot.core.cli test {label}"

Expand Down

0 comments on commit ab7165a

Please sign in to comment.