Skip to content

Commit bddc1c7

Browse files
committed
add model test1
Signed-off-by: Yang Wang <[email protected]>
1 parent 76d0e50 commit bddc1c7

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

.github/workflows/lambda-do-release-runners.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ jobs:
146146
tag: ${{ inputs.tag }}
147147
updateOnlyUnreleased: true
148148

149-
release-oss-ci-aws-ce-tracking:
150-
name: Upload Release for oss-ci-aws-ce-tracking lambda
149+
release-oss-ci-cur:
150+
name: Upload Release for oss-ci-cur lambda
151151
runs-on: ubuntu-latest
152152
permissions:
153153
contents: write
@@ -164,15 +164,15 @@ jobs:
164164
python-version: '3.10'
165165

166166
- name: Build deployment.zip
167-
working-directory: aws/lambda/oss_ci_aws_ce_tracking
167+
working-directory: aws/lambda/oss_ci_cur
168168
run: make deployment.zip
169169

170170
- name: Copy deployment.zip to root
171-
run: cp aws/lambda/oss_ci_aws_ce_tracking/deployment.zip oss-ci-aws-ce-tracking.zip
171+
run: cp aws/lambda/oss_ci_cur/deployment.zip oss-ci-cur.zip
172172

173173
- uses: ncipollo/release-action@440c8c1cb0ed28b9f43e4d1d670870f059653174 # v1.16.0
174174
with:
175-
artifacts: "oss-ci-aws-ce-tracking.zip"
175+
artifacts: "oss-ci-cur.zip"
176176
allowUpdates: true
177177
draft: true
178178
name: ${{ inputs.tag }}

aws/lambda/oss_ci_aws_ce_tracking/lambda_function.py renamed to aws/lambda/oss_ci_cur/lambda_function.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
}
2727

2828
DB_NAME = "misc"
29-
DB_TABLE_NAME = "oss_ci_aws_ce_tracking"
29+
DB_TABLE_NAME = "oss_ci_cur"
3030

3131
# todo(elainewy): make it a shared library for lambda
3232
def get_latest_time_from_table(
@@ -272,7 +272,7 @@ def get_time_range(
272272
# skip the job if the latest time is already covered
273273
if db_end >= end_time:
274274
return None # skip the job if the latest time is already covered
275-
start = max(db_end, start_time).strftime("%Y-%m-%d")
275+
start = db_end.strftime("%Y-%m-%d")
276276
return [start, end]
277277

278278
def start(self, args: Optional[argparse.Namespace] = None):

aws/lambda/tests/test_lambda_oss_ci_aws_ce_tracking.py renamed to aws/lambda/tests/test_lambda_oss_cur.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
)
88
import logging
99

10-
from oss_ci_aws_ce_tracking.lambda_function import (
10+
from oss_ci_cur.lambda_function import (
1111
CostExplorerProcessor,
1212
)
1313

@@ -69,20 +69,20 @@ class TestCostExplorerProcessor(unittest.TestCase):
6969
def setUp(self):
7070
# Mock environment variables
7171
envs_patcher = patch(
72-
"oss_ci_aws_ce_tracking.lambda_function.ENVS",
72+
"oss_ci_cur.lambda_function.ENVS",
7373
new=get_default_environment_variables(),
7474
)
7575
self.mock_envs = envs_patcher.start()
7676
self.addCleanup(envs_patcher.stop)
7777

7878
# Mock boto3 client
79-
boto3_patcher = patch("oss_ci_aws_ce_tracking.lambda_function.boto3.client")
79+
boto3_patcher = patch("oss_ci_cur.lambda_function.boto3.client")
8080
self.mock_boto3_client = boto3_patcher.start()
8181
self.addCleanup(boto3_patcher.stop)
8282

8383
# Mock get_clickhouse_client method
8484
get_clickhouse_client_patcher = patch(
85-
"oss_ci_aws_ce_tracking.lambda_function.get_clickhouse_client"
85+
"oss_ci_cur.lambda_function.get_clickhouse_client"
8686
)
8787
self.mock_get_cc = get_clickhouse_client_patcher.start()
8888
self.addCleanup(get_clickhouse_client_patcher.stop)

0 commit comments

Comments
 (0)