test: ##H@@ Run unit & E2E tests
test: test/unit test/offline test/install test/cov
-.PHONY:test/
-test/:test
+.PHONY: test/
+test/: test
.PHONY: test/cov
test/cov: ##H@@ Combine all coverage data and show report
self.check_license()
# Debug logging toggle
- # Debug logging toggle
- if os.environ.get("GMA_DEBUG"):
+ self.debug = bool(os.environ.get("GMA_DEBUG"))
+ if self.debug:
logger = logging.getLogger()
logger.setLevel(logging.DEBUG)
# Add secure filter
)
with context:
self.set_current(auto_login=False)
+ if self.debug:
+ self.write_log(f"Backend path: {self.db_path}", "debug")
if self.logged and self.fid:
- if self.verbose:
- self.write_log("Successfully reused cached session.")
return True
if self.verbose:
self.write_log("Cached session invalid or expired.")
class Indi:
"""GEDCOM individual class
- :param fid' FamilySearch id
+ :param fid: FamilySearch id
:param tree: a tree object
:param num: the GEDCOM identifier
"""
print(f"✓ {label} matches artifact exactly.")
return True
- print(f"⚠️ {label} differs from artifact. Showing diff (first 10 lines):")
+ print(f"⚠️ {label} differs from artifact. Showing diff (first 20 lines):")
print("Diff Stat:")
subprocess.run(
[
check=False,
)
print("...")
- subprocess.run(
- ["diff", "--color=always", str(generated_path), str(artifact_path)], check=False
- )
+ # Cap output to avoid massive CI logs
+ try:
+ with subprocess.Popen(
+ ["diff", "--color=always", str(generated_path), str(artifact_path)],
+ stdout=subprocess.PIPE,
+ stderr=subprocess.STDOUT,
+ text=True,
+ ) as diff_proc:
+ stdout, _ = diff_proc.communicate(timeout=5)
+ print("\n".join(stdout.splitlines()[:20]))
+ if len(stdout.splitlines()) > 20:
+ print("... (truncated)")
+ except Exception as e:
+ print(f"Error running diff: {e}")
print(f"❌ Verified failed for {label}")
return False