Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flatten the 'db' commands, e.g. 'db prefix' to 'db/prefix' #69

Merged
merged 1 commit into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions reconciler/testdata/batching.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,38 @@ start-reconciler with-batchops
# From here this is the same as incremental.txtar.

# Step 1: Insert non-faulty objects
db insert test-objects obj1.yaml
db insert test-objects obj2.yaml
db insert test-objects obj3.yaml
db cmp test-objects step1+3.table
db/insert test-objects obj1.yaml
db/insert test-objects obj2.yaml
db/insert test-objects obj3.yaml
db/cmp test-objects step1+3.table
expect-ops update(1) update(2) update(3)

# Reconciler should be running and reporting health
health 'job-reconcile.*level=OK.*message=OK, 3 object'

# Step 2: Update object '1' to be faulty and check that it fails and is being
# retried.
db insert test-objects obj1_faulty.yaml
db/insert test-objects obj1_faulty.yaml
expect-ops 'update(1) fail' 'update(1) fail'
db cmp test-objects step2.table
db/cmp test-objects step2.table
health 'job-reconcile.*level=Degraded.*1 error'

# Step 3: Set object '1' back to healthy state
db insert test-objects obj1.yaml
db/insert test-objects obj1.yaml
expect-ops 'update(1)'
db cmp test-objects step1+3.table
db/cmp test-objects step1+3.table
health 'job-reconcile.*level=OK'

# Step 4: Delete '1' and '2'
db delete test-objects obj1.yaml
db delete test-objects obj2.yaml
db cmp test-objects step4.table
db/delete test-objects obj1.yaml
db/delete test-objects obj2.yaml
db/cmp test-objects step4.table
expect-ops 'delete(1)' 'delete(2)'

# Step 5: Try to delete '3' with faulty target
set-faulty true
db delete test-objects obj3.yaml
db cmp test-objects empty.table
db/delete test-objects obj3.yaml
db/cmp test-objects empty.table
expect-ops 'delete(3) fail'
health 'job-reconcile.*level=Degraded.*1 error'

Expand Down
28 changes: 14 additions & 14 deletions reconciler/testdata/incremental.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,39 @@ hive start
start-reconciler

# Step 1: Insert non-faulty objects
db insert test-objects obj1.yaml
db insert test-objects obj2.yaml
db insert test-objects obj3.yaml
db cmp test-objects step1+3.table
db/insert test-objects obj1.yaml
db/insert test-objects obj2.yaml
db/insert test-objects obj3.yaml
db/cmp test-objects step1+3.table
expect-ops update(1) update(2) update(3)

# Reconciler should be running and reporting health
health 'job-reconcile.*level=OK.*message=OK, 3 object'

# Step 2: Update object '1' to be faulty and check that it fails and is being
# retried.
db insert test-objects obj1_faulty.yaml
db cmp test-objects step2.table
db/insert test-objects obj1_faulty.yaml
db/cmp test-objects step2.table
expect-ops 'update(1) fail' 'update(1) fail'
health 'job-reconcile.*level=Degraded.*1 error'

# Step 3: Set object '1' back to healthy state
db insert test-objects obj1.yaml
db show test-objects
db cmp test-objects step1+3.table
db/insert test-objects obj1.yaml
db/show test-objects
db/cmp test-objects step1+3.table
expect-ops 'update(1)'
health 'job-reconcile.*level=OK'

# Step 4: Delete '1' and '2'
db delete test-objects obj1.yaml
db delete test-objects obj2.yaml
db cmp test-objects step4.table
db/delete test-objects obj1.yaml
db/delete test-objects obj2.yaml
db/cmp test-objects step4.table
expect-ops 'delete(1)' 'delete(2)'

# Step 5: Try to delete '3' with faulty target
set-faulty true
db delete test-objects obj3.yaml
db cmp test-objects empty.table
db/delete test-objects obj3.yaml
db/cmp test-objects empty.table
expect-ops 'delete(3) fail'
health 'job-reconcile.*level=Degraded.*1 error'

Expand Down
8 changes: 4 additions & 4 deletions reconciler/testdata/pruning.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ hive start
start-reconciler with-prune

# Pruning without table being initialized does nothing.
db insert test-objects obj1.yaml
db/insert test-objects obj1.yaml
expect-ops update(1)
prune
db insert test-objects obj2.yaml
db/insert test-objects obj2.yaml
expect-ops update(2) update(1)
health 'job-reconcile.*level=OK'

Expand Down Expand Up @@ -33,12 +33,12 @@ expvar
grep 'prune_current_errors.test: 0'

# Delete an object and check pruning happens without it
db delete test-objects obj1.yaml
db/delete test-objects obj1.yaml
prune
expect-ops 'prune(n=1)' delete(1)

# Prune without objects
db delete test-objects obj2.yaml
db/delete test-objects obj2.yaml
prune
expect-ops prune(n=0) delete(2) prune(n=1)

Expand Down
14 changes: 7 additions & 7 deletions reconciler/testdata/refresh.txtar
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,27 @@ hive start
start-reconciler with-refresh

# Step 1: Add a test object.
db insert test-objects obj1.yaml
db/insert test-objects obj1.yaml
expect-ops 'update(1)'
db cmp test-objects step1.table
db/cmp test-objects step1.table

# Step 2: Set the object as updated in the past to force refresh
db insert test-objects obj1_old.yaml
db/insert test-objects obj1_old.yaml
expect-ops 'update-refresh(1)'

# Step 3: Refresh with faulty target, should see fail & retries
set-faulty true
db insert test-objects obj1_old.yaml
db/insert test-objects obj1_old.yaml
expect-ops 'update-refresh(1) fail' 'update-refresh(1) fail'
db cmp test-objects step3.table
db/cmp test-objects step3.table
health
health 'job-reconcile.*Degraded'

# Step 4: Back to health
set-faulty false
db insert test-objects obj1_old.yaml
db/insert test-objects obj1_old.yaml
expect-ops 'update-refresh(1)'
db cmp test-objects step4.table
db/cmp test-objects step4.table
health 'job-reconcile.*OK, 1 object'

# -----
Expand Down
Loading
Loading