SmolFactory / tests /test_monitoring_unchanged.py
Tonic's picture
adds more compatibility with trl
1919b3b verified
#!/usr/bin/env python3
"""
Test to verify that monitoring functionality is unchanged
"""
import trackio
import os
print("Testing that monitoring functionality is unchanged...")
# Test 1: Verify config still works with attributes
config = trackio.config
print(f"βœ… Attribute access: project_name = {config.project_name}")
# Test 2: Verify new dictionary access works
config['test_key'] = 'test_value'
print(f"βœ… Dictionary access: test_key = {config['test_key']}")
# Test 3: Verify both access methods work for same data
config.project_name = 'new_project'
print(f"βœ… Attribute set: project_name = {config.project_name}")
print(f"βœ… Dictionary get: project_name = {config['project_name']}")
# Test 4: Verify update method still works
config.update({'another_key': 'another_value'})
print(f"βœ… Update method: another_key = {config.another_key}")
# Test 5: Verify monitoring functions are unchanged
print(f"βœ… Init function exists: {hasattr(trackio, 'init')}")
print(f"βœ… Log function exists: {hasattr(trackio, 'log')}")
print(f"βœ… Finish function exists: {hasattr(trackio, 'finish')}")
# Test 6: Verify config has all expected methods
print(f"βœ… Config has update: {hasattr(config, 'update')}")
print(f"βœ… Config has __getitem__: {hasattr(config, '__getitem__')}")
print(f"βœ… Config has __setitem__: {hasattr(config, '__setitem__')}")
print("\nπŸŽ‰ All monitoring functionality is preserved!")
print("πŸ“Š The fix only enhances the interface layer without affecting core monitoring.")