Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed invoke check-migrations in ltm #550

Merged
merged 4 commits into from
Sep 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading