Skip to content

Commit

Permalink
Merge pull request #37 from softwaresaved/35-bug-frsm-13-2-does-not-d…
Browse files Browse the repository at this point in the history
…etect-files-as-expected

adjusted FRSM-13 detection logic
  • Loading branch information
karacolada authored Jun 3, 2024
2 parents 1778e73 + 2d21e18 commit 083deb1
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
12 changes: 11 additions & 1 deletion fuji_server/data/software_file.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,16 @@
"(\\w*/)*README(\\.(txt|md))?"
]
},
"dependencies": {
"category": [
"documentation",
"automation"
],
"parse": "file_name",
"pattern": [
"requirements\\.txt"
]
},
"docs_directory": {
"category": [
"documentation"
Expand All @@ -32,7 +42,7 @@
],
"parse": "full",
"pattern": [
"\\.github/workflows/"
"\\.github/workflows(/\\w*\\.\\w*)*"
]
},
"license_file": {
Expand Down
10 changes: 9 additions & 1 deletion fuji_server/evaluators/fair_evaluator_requirements.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ def testDependencies(self):
if test_defined:
test_score = self.getTestConfigScore(test_id)
# Check for presence of machine-readable dependency files
dependency_present = False
dependency_requirements = self.metric_tests[test_id].metric_test_requirements[0]
assert (
dependency_requirements["modality"] == "any"
Expand All @@ -167,7 +168,10 @@ def testDependencies(self):
self.logger.info(
f"{self.metric_identifier} : Checking presence of any of {required_dependency_files} ({test_id})."
)
dependency_present = not set(self.fuji.github_data.keys()).isdisjoint(required_dependency_files)
detected_dependency_files = self.fuji.github_data.get("dependencies", None)
if detected_dependency_files is not None:
detected_dependency_file_names = [dep_f["name"] for dep_f in detected_dependency_files]
dependency_present = not set(detected_dependency_file_names).isdisjoint(required_dependency_files)
# Check for automated building and installation
automation_requirements = self.metric_tests[test_id].metric_test_requirements[1]
required_automation_locations = automation_requirements["required"]["automation_file"]
Expand Down Expand Up @@ -199,10 +203,14 @@ def testDependencies(self):
self.logger.warning(
f"{self.metric_identifier} : Did not find any of {required_dependency_files} ({test_id})."
)
else:
self.logger.log(f"{self.metric_identifier} : Found dependency files ({test_id}).")
if not found_automation:
self.logger.warning(
f"{self.metric_identifier} : Did not find {automation_requirements['modality']} keywords {required_automation_keywords} in {required_automation_locations} ({test_id})."
)
else:
self.logger.warning(f"{self.metric_identifier} : Found automation keywords ({test_id}).")
return test_status

def testDependenciesBuildAutomatedChecks(self):
Expand Down

0 comments on commit 083deb1

Please sign in to comment.