Skip to content

Commit d636ce5

Browse files
author
Mike Storey
committed
Improve StepCI test housekeeping to properly clean up test files
- Update configurations.yaml to unlock files with PUT _locked: false before deletion - Update dictionaries.yaml to unlock files with PUT _locked: false before deletion - Change DELETE expectations from 500 (failure) to 200 (success) after unlocking - Test files are now properly deleted after StepCI tests complete - StepCI enumerator files restored to correct structure (no name/status, has file_name) - All enumerator files unlocked and ready for testing
1 parent 18fbd56 commit d636ce5

File tree

2 files changed

+56
-4
lines changed

2 files changed

+56
-4
lines changed

tests/stepci/configurations.yaml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,34 @@ tests:
102102
sub_events:
103103
type: array
104104

105-
# Cleanup - DELETE the test configuration (should fail when locked)
105+
# Cleanup - Unlock and DELETE the test configuration
106+
- name: Unlock Test Configuration (Cleanup)
107+
http:
108+
url: http://${{env.host}}/api/configurations/test_config.yaml/
109+
method: PUT
110+
headers:
111+
Content-Type: application/json
112+
body: |
113+
{
114+
"description": "Test collection for stepCI testing",
115+
"versions": [
116+
{
117+
"version": "1.0.0.1",
118+
"drop_indexes": [],
119+
"migrations": [],
120+
"add_indexes": [],
121+
"test_data": "test_data.1.0.0.1.json"
122+
}
123+
],
124+
"_locked": false
125+
}
126+
check:
127+
status: /200/
128+
106129
- name: Delete Test Configuration (Cleanup)
107130
http:
108131
url: http://${{env.host}}/api/configurations/test_config.yaml/
109132
method: DELETE
110133
check:
111-
status: /500/
134+
status: /200/
112135

tests/stepci/dictionaries.yaml

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,39 @@ tests:
8888
sub_events:
8989
type: array
9090

91-
# Cleanup - DELETE the test dictionary (should fail when locked)
91+
# Cleanup - Unlock and DELETE the test dictionary
92+
- name: Unlock Test Dictionary (Cleanup)
93+
http:
94+
url: http://${{env.host}}/api/dictionaries/test_dict.yaml/
95+
method: PUT
96+
headers:
97+
Content-Type: application/json
98+
body: |
99+
{
100+
"description": "Test dictionary for stepCI testing",
101+
"version": "1.0.1",
102+
"properties": {
103+
"name": {
104+
"type": "string",
105+
"description": "Name field"
106+
},
107+
"email": {
108+
"type": "email",
109+
"description": "Email field"
110+
},
111+
"phone": {
112+
"type": "us_phone",
113+
"description": "Phone field"
114+
}
115+
},
116+
"_locked": false
117+
}
118+
check:
119+
status: /200/
120+
92121
- name: Delete Test Dictionary (Cleanup)
93122
http:
94123
url: http://${{env.host}}/api/dictionaries/test_dict.yaml/
95124
method: DELETE
96125
check:
97-
status: /500/
126+
status: /200/

0 commit comments

Comments
 (0)