gitarsenal-cli 1.7.7 ā 1.7.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/gitarsenal.js +8 -6
- package/package.json +1 -1
- package/python/__pycache__/test_modalSandboxScript.cpython-313.pyc +0 -0
- package/python/test_dynamic_commands.py +147 -0
- package/python/test_modalSandboxScript.py +609 -241
- package/test_modalSandboxScript.py +609 -241
- package/test_credentials_integration.py +0 -108
@@ -1,108 +0,0 @@
|
|
1
|
-
#!/usr/bin/env python3
|
2
|
-
"""
|
3
|
-
Test script to verify that stored credentials are being passed correctly to SSH containers.
|
4
|
-
"""
|
5
|
-
|
6
|
-
import os
|
7
|
-
import json
|
8
|
-
from pathlib import Path
|
9
|
-
|
10
|
-
def test_credentials_loading():
|
11
|
-
"""Test that credentials can be loaded from the local file"""
|
12
|
-
print("š Testing credentials loading...")
|
13
|
-
|
14
|
-
# Test get_stored_credentials function
|
15
|
-
try:
|
16
|
-
from test_modalSandboxScript import get_stored_credentials
|
17
|
-
credentials = get_stored_credentials()
|
18
|
-
|
19
|
-
if credentials:
|
20
|
-
print(f"ā
Found {len(credentials)} stored credentials:")
|
21
|
-
for key, value in credentials.items():
|
22
|
-
masked_value = value[:8] + "..." if len(value) > 8 else "***"
|
23
|
-
print(f" - {key}: {masked_value}")
|
24
|
-
else:
|
25
|
-
print("ā ļø No stored credentials found")
|
26
|
-
|
27
|
-
return credentials
|
28
|
-
except Exception as e:
|
29
|
-
print(f"ā Error loading credentials: {e}")
|
30
|
-
return {}
|
31
|
-
|
32
|
-
def test_credentials_file():
|
33
|
-
"""Test that the credentials file exists and is readable"""
|
34
|
-
print("\nš Testing credentials file...")
|
35
|
-
|
36
|
-
credentials_file = Path.home() / ".gitarsenal" / "credentials.json"
|
37
|
-
|
38
|
-
if credentials_file.exists():
|
39
|
-
print(f"ā
Credentials file exists at: {credentials_file}")
|
40
|
-
try:
|
41
|
-
with open(credentials_file, 'r') as f:
|
42
|
-
credentials = json.load(f)
|
43
|
-
print(f"ā
Successfully loaded {len(credentials)} credentials from file")
|
44
|
-
return credentials
|
45
|
-
except Exception as e:
|
46
|
-
print(f"ā Error reading credentials file: {e}")
|
47
|
-
return {}
|
48
|
-
else:
|
49
|
-
print(f"ā ļø Credentials file not found at: {credentials_file}")
|
50
|
-
print("š” You can create it by running the credentials manager")
|
51
|
-
return {}
|
52
|
-
|
53
|
-
def test_environment_variables():
|
54
|
-
"""Test that credentials are available as environment variables"""
|
55
|
-
print("\nš Testing environment variables...")
|
56
|
-
|
57
|
-
credential_env_vars = [
|
58
|
-
'OPENAI_API_KEY', 'WANDB_API_KEY', 'HF_TOKEN', 'HUGGINGFACE_TOKEN',
|
59
|
-
'GITHUB_TOKEN', 'KAGGLE_USERNAME', 'KAGGLE_KEY'
|
60
|
-
]
|
61
|
-
|
62
|
-
found_creds = {}
|
63
|
-
for env_var in credential_env_vars:
|
64
|
-
value = os.environ.get(env_var)
|
65
|
-
if value:
|
66
|
-
found_creds[env_var] = value
|
67
|
-
masked_value = value[:8] + "..." if len(value) > 8 else "***"
|
68
|
-
print(f"ā
{env_var}: {masked_value}")
|
69
|
-
|
70
|
-
if not found_creds:
|
71
|
-
print("ā ļø No credential environment variables found")
|
72
|
-
|
73
|
-
return found_creds
|
74
|
-
|
75
|
-
def test_credentials_integration():
|
76
|
-
"""Test the full credentials integration"""
|
77
|
-
print("\n" + "="*60)
|
78
|
-
print("š CREDENTIALS INTEGRATION TEST")
|
79
|
-
print("="*60)
|
80
|
-
|
81
|
-
# Test all credential sources
|
82
|
-
file_creds = test_credentials_file()
|
83
|
-
env_creds = test_environment_variables()
|
84
|
-
function_creds = test_credentials_loading()
|
85
|
-
|
86
|
-
# Combine all credentials
|
87
|
-
all_creds = {}
|
88
|
-
all_creds.update(file_creds)
|
89
|
-
all_creds.update(env_creds)
|
90
|
-
all_creds.update(function_creds)
|
91
|
-
|
92
|
-
print(f"\nš SUMMARY:")
|
93
|
-
print(f" - File credentials: {len(file_creds)}")
|
94
|
-
print(f" - Environment credentials: {len(env_creds)}")
|
95
|
-
print(f" - Function credentials: {len(function_creds)}")
|
96
|
-
print(f" - Total unique credentials: {len(all_creds)}")
|
97
|
-
|
98
|
-
if all_creds:
|
99
|
-
print(f"\nā
Credentials are available for SSH container integration")
|
100
|
-
print("š” These credentials will be automatically passed to SSH containers")
|
101
|
-
else:
|
102
|
-
print(f"\nā ļø No credentials found")
|
103
|
-
print("š” Consider setting up credentials using the credentials manager")
|
104
|
-
|
105
|
-
return all_creds
|
106
|
-
|
107
|
-
if __name__ == "__main__":
|
108
|
-
test_credentials_integration()
|