Skip to content

Commit 0fdf0c0

Browse files
apply suggestions from code review
1 parent 528cac6 commit 0fdf0c0

File tree

10 files changed

+26
-44
lines changed

10 files changed

+26
-44
lines changed

.github/workflows/ci-integration.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
id: modified-apps-step
3535
uses: ./.github/actions/modified_apps
3636
- name: Set up Snowflake CLI
37-
uses: Snowflake-Labs/snowflake-cli-action@v1
37+
uses: Snowflake-Labs/snowflake-cli-action@v1.1
3838
with:
3939
cli-version: "latest"
4040
default-config-file-path: "config.toml"
@@ -49,11 +49,8 @@ jobs:
4949
IFS=',' read -ra modified_apps_array <<< "$modified_apps"
5050
for app in "${modified_apps_array[@]}"; do
5151
cd $app
52-
if [ -f ci.json ]; then
53-
commands=$(jq -r '.commands[]' ci.json)
54-
for command in "${commands[@]}"; do
55-
eval "$command"
56-
done
52+
if [ -f ci.sh ]; then
53+
sh ci.sh
5754
else
5855
snow app run
5956
snow app teardown

.github/workflows/ci.yml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ jobs:
4343
const { MODIFIED_APPS } = process.env;
4444
const fs = require('fs');
4545
const path = require('path');
46-
var has_tests = false;
46+
var has_python_tests = false;
4747
4848
function getPytestPaths(dir, callback)
4949
{
@@ -59,13 +59,8 @@ jobs:
5959
extension = path.extname(file.name);
6060
6161
if (extension == '.py')
62-
{
63-
if (file.name.startsWith('test'))
64-
{
65-
has_tests = true
66-
}
67-
68-
callback(dir);
62+
{
63+
callback(dir, file.name);
6964
}
7065
}
7166
}
@@ -78,9 +73,15 @@ jobs:
7873
for (const rootPath of paths)
7974
{
8075
let subFoldersWithPythonFiles = 0;
81-
getPytestPaths(rootPath, x =>
76+
getPytestPaths(rootPath, (folder, fileName) =>
8277
{
83-
pytestPaths.add(x);
78+
pytestPaths.add(folder);
79+
80+
if (fileName.startsWith('test'))
81+
{
82+
has_python_tests = true
83+
}
84+
8485
subFoldersWithPythonFiles++
8586
})
8687

account-privileges/ci.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

account-privileges/ci.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
snow sql -f 'prepare/references.sql'
2+
snow app run
3+
snow app teardown

data-mapping/ci.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

data-mapping/ci.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
sh prepare_data.sh
2+
snow app run
3+
snow app teardown

reference-usage/ci.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

reference-usage/ci.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
snow sql -f 'prepare/provider.sql'
2+
snow app run
3+
snow app teardown

spcs-three-tier/ci.json

Lines changed: 0 additions & 7 deletions
This file was deleted.

spcs-three-tier/ci.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
sh setup.sh
2+
sh deploy.sh
3+
sh cleanup.sh

0 commit comments

Comments
 (0)