Skip to content

Commit 3329ced

Browse files
committed
fix(tests): Append trailing newline to JSON test outputs
JSON test files generated by the agent test runner were missing trailing newlines, causing the pre-commit end-of-file-fixer hook to fail. Added an explicit newline write on serialization. Change-Id: Idaffc4f2c23fa213f595ddef2188b0050aeb431d
1 parent 6d7bab6 commit 3329ced

7 files changed

Lines changed: 7 additions & 6 deletions

File tree

contributing/samples/tools/parallel_functions/tests/test_all_tools.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,4 +193,4 @@
193193
}
194194
}
195195
]
196-
}
196+
}

contributing/samples/tools/parallel_functions/tests/test_parallel_mixed.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,4 +125,4 @@
125125
}
126126
}
127127
]
128-
}
128+
}

contributing/samples/tools/parallel_functions/tests/test_parallel_weather.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,4 +126,4 @@
126126
}
127127
}
128128
]
129-
}
129+
}

contributing/samples/tools/pydantic_argument/tests/test_create_company.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,4 +136,4 @@
136136
}
137137
}
138138
]
139-
}
139+
}

contributing/samples/tools/pydantic_argument/tests/test_create_user.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,4 @@
101101
}
102102
}
103103
]
104-
}
104+
}

contributing/samples/tools/pydantic_argument/tests/test_create_user_with_prefs.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,4 +104,4 @@
104104
}
105105
}
106106
]
107-
}
107+
}

src/google/adk/cli/agent_test_runner.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -881,6 +881,7 @@ def get_next_fc_id():
881881
# Write back to file
882882
with open(test_file, "w") as f:
883883
json.dump(session_data, f, indent=2, sort_keys=True)
884+
f.write("\n")
884885

885886
print(f"Successfully rebuilt {test_file}")
886887

0 commit comments

Comments
 (0)