Merge pull request #10585 from appwrite/fix-logs-truncation-tests

fix: logs truncation tests
This commit is contained in:
Jake Barnby 2025-10-02 19:22:21 +13:00 committed by GitHub
commit eff3e4bda2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2,8 +2,21 @@ module.exports = async(context) => {
// Create a string that is 1000001 characters long (exceeds the 1000000 limit)
const longString = 'z' + 'a'.repeat(1000000);
context.log(longString);
context.error(longString);
// Split the string into chunks of 8000 characters (max limit for each log and error)
const chunkSize = 8000;
const chunks = [];
for (let i = 0; i < longString.length; i += chunkSize) {
chunks.push(longString.slice(i, i + chunkSize));
}
chunks.forEach((chunk, index) => {
context.log(chunk);
});
chunks.forEach((chunk, index) => {
context.error(chunk);
});
return context.res.json({
motto: 'Build like a team of hundreds_',