Skip to content

Commit

Permalink
apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-osalazarlizano committed Jun 26, 2024
1 parent 528cac6 commit 0fdf0c0
Show file tree
Hide file tree
Showing 10 changed files with 26 additions and 44 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/ci-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
id: modified-apps-step
uses: ./.github/actions/modified_apps
- name: Set up Snowflake CLI
uses: Snowflake-Labs/snowflake-cli-action@v1
uses: Snowflake-Labs/snowflake-cli-action@v1.1
with:
cli-version: "latest"
default-config-file-path: "config.toml"
Expand All @@ -49,11 +49,8 @@ jobs:
IFS=',' read -ra modified_apps_array <<< "$modified_apps"
for app in "${modified_apps_array[@]}"; do
cd $app
if [ -f ci.json ]; then
commands=$(jq -r '.commands[]' ci.json)
for command in "${commands[@]}"; do
eval "$command"
done
if [ -f ci.sh ]; then
sh ci.sh
else
snow app run
snow app teardown
Expand Down
21 changes: 11 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
const { MODIFIED_APPS } = process.env;
const fs = require('fs');
const path = require('path');
var has_tests = false;
var has_python_tests = false;
function getPytestPaths(dir, callback)
{
Expand All @@ -59,13 +59,8 @@ jobs:
extension = path.extname(file.name);
if (extension == '.py')
{
if (file.name.startsWith('test'))
{
has_tests = true
}
callback(dir);
{
callback(dir, file.name);
}
}
}
Expand All @@ -78,9 +73,15 @@ jobs:
for (const rootPath of paths)
{
let subFoldersWithPythonFiles = 0;
getPytestPaths(rootPath, x =>
getPytestPaths(rootPath, (folder, fileName) =>
{
pytestPaths.add(x);
pytestPaths.add(folder);
if (fileName.startsWith('test'))
{
has_python_tests = true
}
subFoldersWithPythonFiles++
})
Expand Down
7 changes: 0 additions & 7 deletions account-privileges/ci.json

This file was deleted.

3 changes: 3 additions & 0 deletions account-privileges/ci.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
snow sql -f 'prepare/references.sql'
snow app run
snow app teardown
7 changes: 0 additions & 7 deletions data-mapping/ci.json

This file was deleted.

3 changes: 3 additions & 0 deletions data-mapping/ci.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sh prepare_data.sh
snow app run
snow app teardown
7 changes: 0 additions & 7 deletions reference-usage/ci.json

This file was deleted.

3 changes: 3 additions & 0 deletions reference-usage/ci.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
snow sql -f 'prepare/provider.sql'
snow app run
snow app teardown
7 changes: 0 additions & 7 deletions spcs-three-tier/ci.json

This file was deleted.

3 changes: 3 additions & 0 deletions spcs-three-tier/ci.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sh setup.sh
sh deploy.sh
sh cleanup.sh

0 comments on commit 0fdf0c0

Please sign in to comment.