SIENTIAPDE-1241: Refactor: Remove redundant logging and fix duplicate logs
This commit removes redundant logging statements from training and experiment tracking activities, preventing duplicate log entries. It also introduces a logger helper to disable log propagation, further addressing the duplicate logs issue. Additionally, the Makefile, run_coverage.sh, setup_port_forwards.sh, and simulator/Dockerfile files were removed as they are no longer needed.
This commit is contained in:
47
validate.sh
47
validate.sh
@@ -1,9 +1,39 @@
|
||||
#!/bin/bash
|
||||
# Model Manager Code Validation Script
|
||||
# This script runs all code quality checks before committing or deploying
|
||||
#
|
||||
# Usage:
|
||||
# ./validate.sh # Run all checks including tests (default)
|
||||
# ./validate.sh --no-tests # Skip unit tests
|
||||
# ./validate.sh --skip-tests # Skip unit tests (alias)
|
||||
|
||||
set -e # Exit on any error
|
||||
|
||||
# Parse command line arguments
|
||||
RUN_TESTS=true
|
||||
for arg in "$@"; do
|
||||
case $arg in
|
||||
--no-tests|--skip-tests)
|
||||
RUN_TESTS=false
|
||||
shift
|
||||
;;
|
||||
--help|-h)
|
||||
echo "Usage: $0 [OPTIONS]"
|
||||
echo ""
|
||||
echo "Options:"
|
||||
echo " --no-tests, --skip-tests Skip unit tests (default: run tests)"
|
||||
echo " --help, -h Show this help message"
|
||||
echo ""
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
echo "Unknown option: $arg"
|
||||
echo "Use --help for usage information"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Colors for output
|
||||
RED='\033[0;31m'
|
||||
GREEN='\033[0;32m'
|
||||
@@ -16,6 +46,11 @@ echo -e "${BLUE}║ Model Manager - Code Validation Suite ║${N
|
||||
echo -e "${BLUE}╚════════════════════════════════════════════════════════╝${NC}"
|
||||
echo ""
|
||||
|
||||
if [ "$RUN_TESTS" = false ]; then
|
||||
echo -e "${YELLOW}ℹ️ Unit tests will be skipped${NC}"
|
||||
echo ""
|
||||
fi
|
||||
|
||||
# Check if virtual environment is activated
|
||||
if [[ -z "${VIRTUAL_ENV}" ]] && [[ -z "${CONDA_DEFAULT_ENV}" ]]; then
|
||||
echo -e "${YELLOW}⚠️ Warning: No virtual environment detected${NC}"
|
||||
@@ -67,8 +102,16 @@ if ! run_step "4. Security Analysis (Bandit)" "bandit -r model_manager/ -ll -q";
|
||||
fi
|
||||
|
||||
# Step 5: Unit Tests (pytest)
|
||||
if ! run_step "5. Unit Tests (pytest)" "pytest tests/ --cov=model_manager --cov-report=term-missing --cov-report=xml --cov-report=html --cov-fail-under=80 -q"; then
|
||||
FAILED_STEPS+=("Unit Tests")
|
||||
if [ "$RUN_TESTS" = true ]; then
|
||||
if ! run_step "5. Unit Tests (pytest)" "pytest tests/ --cov=model_manager --cov-report=term-missing --cov-report=xml --cov-report=html --cov-fail-under=80 -q"; then
|
||||
FAILED_STEPS+=("Unit Tests")
|
||||
fi
|
||||
else
|
||||
echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
||||
echo -e "${BLUE}▶ 5. Unit Tests (pytest)${NC}"
|
||||
echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
||||
echo -e "${YELLOW}⏭️ Unit Tests - SKIPPED${NC}"
|
||||
echo ""
|
||||
fi
|
||||
|
||||
# Summary
|
||||
|
||||
Reference in New Issue
Block a user