Conversation
| .PHONY: watch | ||
| watch: ## watch everything and continuously rebuild | ||
| @bash tools/watch.sh | ||
| watch: ## watch everything (optional: WATCH_DB=sqlite|mysql|pgsql|mssql WATCH_ACT=true) |
There was a problem hiding this comment.
- there is no other "DB" that needs to "watch".
- there is no "ACT" at the moment.
Off-topic: maybe it should really introduce this: WIP: Pure Go SQLite3 #32628 , then no build tag is needed anymore.
There was a problem hiding this comment.
afaik you were sort of against it - #20614 (comment)
I wouldn't mind having sqlite built-in without tags though.
There was a problem hiding this comment.
The wasm one isn't like that CCGO based "pure Go" solution. The wasm one is 100% (at least >99%) complied from official SQLite C code, so I would consider it as safe and stable enough for production.
I was just against CCGO at that time 😄
To explain more for WASM ecosystem: mature compiler, mature VM. CCGO is cool and awesome, wasm is the future (IMHO)
There was a problem hiding this comment.
My bad! I assumed this was the same solution (modernrc) and did not look at what it's imported in your PR (ncruces).
seems decent. At least better for us since we don't have to support sqlite tags.
There was a problem hiding this comment.
Update: it seems that ncruces changed its solution.
- Old ncruces: SQLite C -> WASM compiler -> WASM code -> WASM VM
- New ncruces: SQLite C -> WASM compiler -> WASM code -> ncruces wasm2go -> Go code
- modernrc: SQLite C -> modernrc CCGO compiler -> Go code
Still, modernrc CCGO is much more complicated than ncruces wasm2go 🤣
There was a problem hiding this comment.
cznic (native)
we call it "modernc", its package is modernc.org/sqlite
There was a problem hiding this comment.
modernc.org/sqlite
Right, the module path still is that: https://gitlab.com/cznic/sqlite/-/blob/master/go.mod#L1
There was a problem hiding this comment.
ncruces seems slower to compile from scratch. Not a big issue though. It requires one less workaround but the changes in how parameters are passed seem the same.
Size diff (same base, only changed enough to get it compiling and browsable):
+6MB on ncruces
+1.1MB on modernrc
Respective branches:
https://github.com/TheFox0x7/gitea/tree/modernrc-sqlite
https://github.com/TheFox0x7/gitea/tree/ncurces-sqlite
Let me know if you have something I should try or which one to start as draft
There was a problem hiding this comment.
Some benchmarks at https://github.com/cvilsmeier/go-sqlite-bench, modernc seems slightly faster on average.
|
Since you're considering more targets, maybe we could have the "dev instance" one? I still have yet to figure out how can I deploy the exact instance we have preconfigured for tests which makes finding the right setup more complex than it needs to be. |
Could you elaborate? Didn't get the point. |
|
I worked on some bug here and I had to dive into the db schemas and repositories to find which user has which repository and what's in them to set the test up. I think it's useful for integration tests to see how the system is setup and for example try out your test in UI first to find the good way to perform it. Plus as a general unified demo setup it could work too. |
|
Do you mean something like this ? add develop script to view and update test data #26594 ? |
|
You mean some sort of database pre-seeding for demo purposes? |
Yup. Exactly that. Though it might be out of scope for this change... now that I look at it.
It's less for a demo more for figuring out a setup for integration test. Demo is just a side effect here. |
Maybe it's better not looking at it. 26594 made things too complicated. For "viewing test data", it can just copy the test fixtures to a temp dir, start a server, that's all. It shouldn't "update" the existing data from the "test view server". |
By the way, to make the CI/testing system maintainable, we should avoid adding any more test data in to the fixtures. The tests should create their own test fixtures, or create data dynamically. |
Just model after e2e tests. every test creates all dependencies it needs itself. Fully parallelizeable, no shared fixtures, no shared state, can be made arbritrarily fast via more CPU cores. Every test is "pure". |
WIP!!!
need feedback from @silverwind as discussed