recce-nightly 1.16.0.20250813__py3-none-any.whl → 1.16.0.20250814__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of recce-nightly might be problematic. Click here for more details.
- recce/VERSION +1 -1
- recce/cli.py +13 -4
- recce/data/404.html +1 -1
- recce/data/_next/static/chunks/app/page-501b751b630a2ef8.js +1 -0
- recce/data/index.html +1 -1
- recce/data/index.txt +2 -2
- recce/state/__init__.py +31 -0
- recce/state/cloud.py +384 -0
- recce/state/const.py +26 -0
- recce/state/local.py +56 -0
- recce/state/state.py +118 -0
- recce/state/state_loader.py +179 -0
- {recce_nightly-1.16.0.20250813.dist-info → recce_nightly-1.16.0.20250814.dist-info}/METADATA +1 -1
- {recce_nightly-1.16.0.20250813.dist-info → recce_nightly-1.16.0.20250814.dist-info}/RECORD +23 -19
- tests/test_cli.py +3 -3
- tests/test_core.py +147 -0
- tests/test_server.py +6 -6
- recce/data/_next/static/chunks/app/page-e8f798c2ae3f59c2.js +0 -1
- recce/state.py +0 -865
- tests/test_state.py +0 -134
- /recce/data/_next/static/{RX_nnCGyE7ZOeoTStwYCZ → ee0xgtj4tA9NSgi1ChDxe}/_buildManifest.js +0 -0
- /recce/data/_next/static/{RX_nnCGyE7ZOeoTStwYCZ → ee0xgtj4tA9NSgi1ChDxe}/_ssgManifest.js +0 -0
- {recce_nightly-1.16.0.20250813.dist-info → recce_nightly-1.16.0.20250814.dist-info}/WHEEL +0 -0
- {recce_nightly-1.16.0.20250813.dist-info → recce_nightly-1.16.0.20250814.dist-info}/entry_points.txt +0 -0
- {recce_nightly-1.16.0.20250813.dist-info → recce_nightly-1.16.0.20250814.dist-info}/licenses/LICENSE +0 -0
- {recce_nightly-1.16.0.20250813.dist-info → recce_nightly-1.16.0.20250814.dist-info}/top_level.txt +0 -0
tests/test_state.py
DELETED
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
# add the RecceState test case
|
|
2
|
-
import os
|
|
3
|
-
import unittest
|
|
4
|
-
from datetime import datetime
|
|
5
|
-
|
|
6
|
-
from recce.core import RecceContext
|
|
7
|
-
from recce.models import Check, Run
|
|
8
|
-
from recce.state import ArtifactsRoot, RecceState, RecceStateLoader
|
|
9
|
-
|
|
10
|
-
current_dir = os.path.dirname(os.path.abspath(__file__))
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
class TestRecceState(unittest.TestCase):
|
|
14
|
-
def test_merge_checks(self):
|
|
15
|
-
check1 = Check(name="test1", description="", type="query")
|
|
16
|
-
check2 = Check(name="test2", description="", type="query", updated_at=datetime(2000, 1, 1))
|
|
17
|
-
check2_2 = Check(
|
|
18
|
-
name="test2_2", description="", type="query", updated_at=datetime(2020, 1, 1), check_id=check2.check_id
|
|
19
|
-
)
|
|
20
|
-
check3 = Check(name="test3", description="", type="query")
|
|
21
|
-
|
|
22
|
-
context = RecceContext()
|
|
23
|
-
state = RecceState(checks=[check1], runs=[])
|
|
24
|
-
context.import_state(state)
|
|
25
|
-
self.assertEqual(1, len(context.checks))
|
|
26
|
-
self.assertEqual(check1.name, context.checks[0].name)
|
|
27
|
-
|
|
28
|
-
context = RecceContext(checks=[check1, check2])
|
|
29
|
-
state = RecceState(checks=[check1, check2_2, check3], runs=[])
|
|
30
|
-
context.import_state(state)
|
|
31
|
-
self.assertEqual(3, len(context.checks))
|
|
32
|
-
self.assertEqual(check2_2.name, context.checks[1].name)
|
|
33
|
-
|
|
34
|
-
def test_merge_preset_checks(self):
|
|
35
|
-
check1 = Check(
|
|
36
|
-
name="test1",
|
|
37
|
-
description="test1",
|
|
38
|
-
type="query",
|
|
39
|
-
params=dict(foo="bar"),
|
|
40
|
-
updated_at=datetime(2000, 1, 1),
|
|
41
|
-
is_preset=True,
|
|
42
|
-
)
|
|
43
|
-
check2 = Check(
|
|
44
|
-
name="test2",
|
|
45
|
-
description="test2",
|
|
46
|
-
type="query",
|
|
47
|
-
params=dict(foo="bar"),
|
|
48
|
-
updated_at=datetime(2001, 1, 1),
|
|
49
|
-
is_preset=True,
|
|
50
|
-
)
|
|
51
|
-
|
|
52
|
-
context = RecceContext(checks=[check1])
|
|
53
|
-
state = RecceState(checks=[check2], runs=[])
|
|
54
|
-
context.import_state(state)
|
|
55
|
-
self.assertEqual(1, len(context.checks))
|
|
56
|
-
self.assertEqual(check2.name, context.checks[0].name)
|
|
57
|
-
|
|
58
|
-
context = RecceContext(checks=[check2])
|
|
59
|
-
state = RecceState(checks=[check1], runs=[])
|
|
60
|
-
context.import_state(state)
|
|
61
|
-
self.assertEqual(1, len(context.checks))
|
|
62
|
-
self.assertEqual(check2.name, context.checks[0].name)
|
|
63
|
-
|
|
64
|
-
def test_revert_checks(self):
|
|
65
|
-
check1 = Check(name="test1", description="", type="query")
|
|
66
|
-
check2 = Check(name="test2", description="", type="query")
|
|
67
|
-
check2_2 = Check(name="test2_2", description="", type="query", check_id=check2.check_id)
|
|
68
|
-
check3 = Check(name="test3", description="", type="query")
|
|
69
|
-
|
|
70
|
-
context = RecceContext(checks=[check1, check2])
|
|
71
|
-
state = RecceState(checks=[check2_2, check3], runs=[])
|
|
72
|
-
context.import_state(state, merge=False)
|
|
73
|
-
self.assertEqual(2, len(context.checks))
|
|
74
|
-
self.assertEqual(check2_2.name, context.checks[0].name)
|
|
75
|
-
|
|
76
|
-
def test_merge_runs(self):
|
|
77
|
-
run1 = Run(type="query")
|
|
78
|
-
run2 = Run(type="query")
|
|
79
|
-
run3 = Run(type="query")
|
|
80
|
-
|
|
81
|
-
context = RecceContext(runs=[])
|
|
82
|
-
state = RecceState(runs=[run1])
|
|
83
|
-
context.import_state(state)
|
|
84
|
-
self.assertEqual(1, len(context.runs))
|
|
85
|
-
|
|
86
|
-
context = RecceContext(runs=[run1, run2])
|
|
87
|
-
state = RecceState(runs=[run2, run3])
|
|
88
|
-
context.import_state(state)
|
|
89
|
-
self.assertEqual(3, len(context.runs))
|
|
90
|
-
|
|
91
|
-
def test_merge_dbt_artifacts(self):
|
|
92
|
-
import json
|
|
93
|
-
import os
|
|
94
|
-
|
|
95
|
-
with open(os.path.join(current_dir, "manifest.json"), "r") as f:
|
|
96
|
-
manifest = json.load(f)
|
|
97
|
-
manifest["metadata"]["generated_at"] = "2000-01-01T00:00:00Z"
|
|
98
|
-
artifacts = ArtifactsRoot(
|
|
99
|
-
base=dict(
|
|
100
|
-
manifest=manifest,
|
|
101
|
-
),
|
|
102
|
-
current=dict(
|
|
103
|
-
manifest=manifest,
|
|
104
|
-
),
|
|
105
|
-
)
|
|
106
|
-
|
|
107
|
-
from tests.adapter.dbt_adapter.dbt_test_helper import DbtTestHelper
|
|
108
|
-
|
|
109
|
-
adapter = DbtTestHelper().adapter
|
|
110
|
-
adapter.import_artifacts(artifacts)
|
|
111
|
-
self.assertNotEqual(adapter.base_manifest.metadata.invocation_id, manifest.get("metadata").get("invocation_id"))
|
|
112
|
-
|
|
113
|
-
manifest["metadata"]["generated_at"] = "2099-01-01T00:00:00Z"
|
|
114
|
-
adapter.import_artifacts(artifacts)
|
|
115
|
-
self.assertEqual(adapter.base_manifest.metadata.invocation_id, manifest.get("metadata").get("invocation_id"))
|
|
116
|
-
|
|
117
|
-
def test_state_loader(self):
|
|
118
|
-
# copy ./recce_state.json to temp and open
|
|
119
|
-
|
|
120
|
-
# use library to create a temp file in the context
|
|
121
|
-
import os
|
|
122
|
-
import shutil
|
|
123
|
-
import tempfile
|
|
124
|
-
|
|
125
|
-
with tempfile.NamedTemporaryFile() as f:
|
|
126
|
-
# copy ./recce_state.json to temp file
|
|
127
|
-
current_dir = os.path.dirname(os.path.abspath(__file__))
|
|
128
|
-
state_file = os.path.join(current_dir, "recce_state.json")
|
|
129
|
-
shutil.copy(state_file, f.name)
|
|
130
|
-
|
|
131
|
-
# load the state file
|
|
132
|
-
state_loader = RecceStateLoader(state_file=f.name)
|
|
133
|
-
state = state_loader.load()
|
|
134
|
-
assert len(state.runs) == 17
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{recce_nightly-1.16.0.20250813.dist-info → recce_nightly-1.16.0.20250814.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{recce_nightly-1.16.0.20250813.dist-info → recce_nightly-1.16.0.20250814.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
{recce_nightly-1.16.0.20250813.dist-info → recce_nightly-1.16.0.20250814.dist-info}/top_level.txt
RENAMED
|
File without changes
|