Skip to content

Commit

Permalink
Merge pull request fga-eps-mds#16 from fga-eps-mds/fix/fixing_imports
Browse files Browse the repository at this point in the history
fix: correcting imports
  • Loading branch information
ArielSixwings authored Dec 9, 2023
2 parents 50b17cd + c79a265 commit db93e4f
Show file tree
Hide file tree
Showing 7 changed files with 140 additions and 7 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"

[project]
name = "msgram_core"
version = "1.4.4"
version = "1.4.5"
description = "The MeasureSoftGram-Core is a Software system for continuous quality of product observation and multidimensional use in continuous design engineering software and is where you have the innovative mathematical models for software analysis."
readme = "README.md"
authors = [
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_aggregated_normalized_measures.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
INVALID_THRESHOLD_TEST_DATA,
SUCCESS_TEST_DATA,
)
from src.util.exceptions import InvalidMetricValue, InvalidThresholdValue
from util.exceptions import InvalidMetricValue, InvalidThresholdValue


@pytest.mark.parametrize(
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_analysis.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest
from marshmallow.exceptions import ValidationError

from src.resources.analysis import (
from resources.analysis import (
calculate_characteristics,
calculate_measures,
calculate_subcharacteristics,
Expand Down
80 changes: 80 additions & 0 deletions tests/unit/test_schemas.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import pytest
from marshmallow.exceptions import ValidationError

from core.schemas import (
NonComplexFileDensitySchema,
CommentedFileDensitySchema,
DuplicationAbsenceSchema,
PassedTestsSchema,
TestBuildsSchema,
TestCoverageSchema,
CIFeedbackTimeSchema,
TeamThroughputSchema,
)

from tests.utils.schemas_data import (
NON_COMPLEX_FILES_DENSITY_METRICS_DATA,
COMMENTED_FILE_DENSITY_METRICS_DATA,
DUPLICATION_ABSENCE_METRICS_DATA,
PASSED_TESTS_METRICS_DATA,
TEST_BUILDS_METRICS_DATA,
TEST_COVERAGE_METRICS_DATA,
CI_FEEDBACK_TIME_METRICS_DATA,
TEAM_THROUGHPUT_METRICS_DATA,
)


def test_non_complex_file_density_schema_validation():
try:
NonComplexFileDensitySchema().load(NON_COMPLEX_FILES_DENSITY_METRICS_DATA)
except ValidationError as e:
pytest.fail(f"Unexpected error: {e}")


def test_commented_file_density_schema_validation():
try:
CommentedFileDensitySchema().load(COMMENTED_FILE_DENSITY_METRICS_DATA)
except ValidationError as e:
pytest.fail(f"Unexpected error: {e}")


def test_duplication_absence_schema_validation():
try:
DuplicationAbsenceSchema().load(DUPLICATION_ABSENCE_METRICS_DATA)
except ValidationError as e:
pytest.fail(f"Unexpected error: {e}")


def test_passed_tests_schema_validation():
try:
PassedTestsSchema().load(PASSED_TESTS_METRICS_DATA)
except ValidationError as e:
pytest.fail(f"Unexpected error: {e}")


def test_test_builds_schema_validation():
try:
TestBuildsSchema().load(TEST_BUILDS_METRICS_DATA)
except ValidationError as e:
pytest.fail(f"Unexpected error: {e}")


def test_test_coverage_schema_validation():
try:
TestCoverageSchema().load(TEST_COVERAGE_METRICS_DATA)
except ValidationError as e:
pytest.fail(f"Unexpected error: {e}")


def test_ci_feedback_time_schema_validation():
try:
CIFeedbackTimeSchema().load(CI_FEEDBACK_TIME_METRICS_DATA)
except ValidationError as e:
pytest.fail(f"Unexpected error: {e}")


def test_team_throughput_schema_validation():
try:
TeamThroughputSchema().load(TEAM_THROUGHPUT_METRICS_DATA)
except ValidationError as e:
pytest.fail(f"Unexpected error: {e}")
4 changes: 2 additions & 2 deletions tests/unit/test_transformations.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import pytest
from src.core.transformations import diff, norm_diff
from core.transformations import diff, norm_diff
from tests.utils.transformations_data import INVALID_DIFF_DATA, VALID_DIFF_DATA
from src.util.exceptions import ReleasePlannedAndDevelopedOfDifferentSizes
from util.exceptions import ReleasePlannedAndDevelopedOfDifferentSizes
import numpy as np


Expand Down
4 changes: 2 additions & 2 deletions tests/utils/aggregated_normalized_measures_data.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
from src.core.aggregated_normalized_measures import (
from core.aggregated_normalized_measures import (
absence_of_duplications,
commented_files_density,
fast_test_builds,
non_complex_files_density,
passed_tests,
)
from src.core.aggregated_normalized_measures import (
from core.aggregated_normalized_measures import (
test_coverage as interpret_test_coverage,
)

Expand Down
53 changes: 53 additions & 0 deletions tests/utils/schemas_data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
NON_COMPLEX_FILES_DENSITY_METRICS_DATA = {
"metrics": [
{"key": "complexity", "value": [0.7]},
{"key": "functions", "value": [0.5]},
]
}

COMMENTED_FILE_DENSITY_METRICS_DATA = {
"metrics": [
{"key": "comment_lines_density", "value": [0.5]},
]
}

DUPLICATION_ABSENCE_METRICS_DATA = {
"metrics": [
{"key": "duplicated_lines_density", "value": [0.1]},
]
}

PASSED_TESTS_METRICS_DATA = {
"metrics": [
{"key": "tests", "value": [10.0]},
{"key": "test_failures", "value": [1.0]},
{"key": "test_errors", "value": [0.0]},
]
}

TEST_BUILDS_METRICS_DATA = {
"metrics": [
{"key": "test_execution_time", "value": [8.0]},
{"key": "tests", "value": [10.0]},
]
}

TEST_COVERAGE_METRICS_DATA = {
"metrics": [
{"key": "coverage", "value": [0.75]},
]
}

CI_FEEDBACK_TIME_METRICS_DATA = {
"metrics": [
{"key": "sum_ci_feedback_times", "value": [15.0]},
{"key": "total_builds", "value": [20.0]},
]
}

TEAM_THROUGHPUT_METRICS_DATA = {
"metrics": [
{"key": "resolved_issues", "value": [15.0]},
{"key": "total_issues", "value": [20.0]},
]
}

0 comments on commit db93e4f

Please sign in to comment.