From cf8c615c7a9f7317232d17ae336a9c0505a2c83c Mon Sep 17 00:00:00 2001 From: Animesh Kumar Date: Fri, 5 Jul 2024 15:06:15 +0530 Subject: [PATCH] chore: test run for the workflow Changes: - add process.exit(1) at appropriate locations --- scripts/validation/embedded-examples-validation.js | 8 +++++++- spec/asyncapi.md | 2 +- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/validation/embedded-examples-validation.js b/scripts/validation/embedded-examples-validation.js index 2a13254a..b5f71341 100644 --- a/scripts/validation/embedded-examples-validation.js +++ b/scripts/validation/embedded-examples-validation.js @@ -37,6 +37,7 @@ function extractCommentsAndExamples(content) { }); } catch (e) { console.error("Failed to parse comment JSON or example:", match[1], e); + process.exit(1); } } @@ -71,6 +72,7 @@ function applyUpdates(updates, baseDoc) { } catch (e) { console.error(`\nError processing update for '${update.name}' at path '${update.json_pointer}'`, e); + process.exit(1); } }); return baseDoc; @@ -85,8 +87,10 @@ async function validateParser(document, name) { diagnostics.forEach(diagnostic => { if (diagnostic.level === 'error') { console.error(`\x1b[31mError in ${name}: ${diagnostic.message}\x1b[0m`); + process.exit(1); } else { - console.log(`\x1b[31mWarning in ${name}: ${diagnostic.message}\x1b[0m`); + console.log(`\x1b[31mError in ${name}: ${diagnostic.message}\x1b[0m`); + process.exit(1); } }); } else { @@ -94,6 +98,7 @@ async function validateParser(document, name) { } } catch (error) { console.error(`\x1b[31mValidation failed for ${name}: ${error.message}\x1b[0m`); + process.exit(1); } } @@ -119,4 +124,5 @@ Promise.all(validationPromises) }) .catch((error) => { console.error('Error during validations:', error); + process.exit(1); }); \ No newline at end of file diff --git a/spec/asyncapi.md b/spec/asyncapi.md index d851bc42..26956f5b 100644 --- a/spec/asyncapi.md +++ b/spec/asyncapi.md @@ -1383,7 +1383,7 @@ Example using Avro to define the payload: "payload": { "schemaFormat": "application/vnd.apache.avro+json;version=1.9.0", "schema": { - "$ref": "./user-create.avsc" + "$ref": "../user-create.avsc" } } }