mirror of
https://github.com/go-admin-team/go-admin.git
synced 2026-09-29 04:27:17 +00:00
The generator had no test that compiled what it writes; test/gen_test.go is commented out. This one goes through the real path end to end: fixture tables in MySQL, the import handler, GenCode writing its files, the files compiled into this module's own packages through a -overlay, and a CRUD test run over HTTP against the generated handlers. The shapes are an int key named id, an int key named otherwise, a string key, no key and a composite key. The last two must be refused with nothing written. For the rest: read and update through the path parameter, a missing key neither found nor created by an update, a key of "1=1" read as a value, and delete by key. The importer only reads MySQL, so the test needs GO_ADMIN_TEST_MYSQL_DSN; without it the test skips locally and fails under CI. It also asserts each generated CRUD test actually ran, since a -run pattern that matches nothing exits 0.