API client generation: Add verify-api-clients step to drone (#99987)
* add verify-api-clients step to drone * change to check the verify step fails * ignore conf dir * rerun make drone * undo change to make step fail
This commit is contained in:
@@ -12,6 +12,7 @@ load(
|
||||
"enterprise_setup_step",
|
||||
"identify_runner_step",
|
||||
"lint_frontend_step",
|
||||
"verify_api_clients_step",
|
||||
"verify_i18n_step",
|
||||
"yarn_install_step",
|
||||
)
|
||||
@@ -35,6 +36,7 @@ def lint_frontend_pipeline(trigger, ver_mode):
|
||||
init_steps = []
|
||||
lint_step = lint_frontend_step()
|
||||
i18n_step = verify_i18n_step()
|
||||
api_clients_step = verify_api_clients_step()
|
||||
|
||||
volumes = []
|
||||
|
||||
@@ -54,6 +56,7 @@ def lint_frontend_pipeline(trigger, ver_mode):
|
||||
test_steps = [
|
||||
lint_step,
|
||||
i18n_step,
|
||||
api_clients_step,
|
||||
]
|
||||
|
||||
return pipeline(
|
||||
|
||||
@@ -676,6 +676,28 @@ def verify_i18n_step():
|
||||
],
|
||||
}
|
||||
|
||||
def verify_api_clients_step():
|
||||
uncommited_error_message = "\nAPI client generation has not been committed. Please run 'yarn generate-apis', commit the changes and push again."
|
||||
return {
|
||||
"name": "verify-api-clients",
|
||||
"image": images["node_deb"],
|
||||
"depends_on": [
|
||||
"yarn-install",
|
||||
],
|
||||
"commands": [
|
||||
"yarn generate-apis",
|
||||
# Verify that client generation has been run and committed
|
||||
'''
|
||||
file_diff=$(git diff ':!conf')
|
||||
if [ -n "$file_diff" ]; then
|
||||
echo $file_diff
|
||||
echo "{}"
|
||||
exit 1
|
||||
fi
|
||||
'''.format(uncommited_error_message),
|
||||
],
|
||||
}
|
||||
|
||||
def test_a11y_frontend_step(ver_mode, port = 3001):
|
||||
"""Runs automated accessiblity tests against the frontend.
|
||||
|
||||
|
||||
@@ -168,10 +168,10 @@ function processDirectory(sourceDir: string, outputDir: string) {
|
||||
}
|
||||
|
||||
const sourceDirs = [
|
||||
path.resolve(__dirname, '../pkg/tests/apis/openapi_snapshots'),
|
||||
path.resolve(__dirname, '../pkg/extensions/apiserver/tests/openapi_snapshots'),
|
||||
path.resolve(import.meta.dirname, '../pkg/tests/apis/openapi_snapshots'),
|
||||
path.resolve(import.meta.dirname, '../pkg/extensions/apiserver/tests/openapi_snapshots'),
|
||||
];
|
||||
const outputDir = path.resolve(__dirname, '../data/openapi');
|
||||
const outputDir = path.resolve(import.meta.dirname, '../data/openapi');
|
||||
|
||||
for (const sourceDir of sourceDirs) {
|
||||
processDirectory(sourceDir, outputDir);
|
||||
|
||||
Reference in New Issue
Block a user