Index a one-file client and a one-file server project through the production * pipeline. Closes both stores again — cbm_cross_repo_match re-opens the DBs * from the cache dir. Returns false when either project failed to index or the * PRECONDITIONS (client HTTP_CALLS edge, server Route node) are missing, so a * broken fixture fails RED instead of vacuously passing. */
| 244 | * PRECONDITIONS (client HTTP_CALLS edge, server Route node) are missing, so a |
| 245 | * broken fixture fails RED instead of vacuously passing. */ |
| 246 | static bool cr536_setup(RProj *client, const char *client_py, RProj *server, |
| 247 | const char *server_py) { |
| 248 | memset(client, 0, sizeof(*client)); |
| 249 | memset(server, 0, sizeof(*server)); |
| 250 | cbm_store_t *cs = rh_index(client, "client/orders.py", client_py); |
| 251 | if (!cs) { |
| 252 | return false; |
| 253 | } |
| 254 | int client_http = rh_count_edges(cs, client->project, "HTTP_CALLS"); |
| 255 | cbm_store_close(cs); |
| 256 | |
| 257 | cbm_store_t *ss = rh_index(server, "server/app.py", server_py); |
| 258 | if (!ss) { |
| 259 | return false; |
| 260 | } |
| 261 | int server_routes = rh_count_label(ss, server->project, "Route"); |
| 262 | cbm_store_close(ss); |
| 263 | |
| 264 | fprintf(stderr, " [523] precondition: client HTTP_CALLS=%d server Routes=%d (both >=1)\n", |
| 265 | client_http, server_routes); |
| 266 | return client_http >= 1 && server_routes >= 1; |
| 267 | } |
| 268 | |
| 269 | /* Count CROSS_HTTP_CALLS rows in a project DB (re-opened from the cache dir, |
| 270 | * because cbm_cross_repo_match wrote through its own store handles). */ |
no test coverage detected