It looks like the scope is larger than I thought. If we want to retire the `admin api`, we also need to provide a new layer of admin API since other tests like t/node/filter_func.t need to talk with admin. Should it be a thin layer which talks directly with etcd? Anyway, we still need a stable schema (or a good layer to hide the details) for testing. BTW, is there a E2E test plan to cover the communication of two projects?
JunXu Chen <[email protected]> 于2020年10月18日周日 下午4:20写道: > @Zexuan @vinci > > For option 2, > After `manager api` completely replaces `admin api`, APISIX can't write > data by itself, so how to run test cases in APISIX repo ? It's also a > question to consider. > > > > > On Sun, Oct 18, 2020 at 4:17 PM JunXu Chen <[email protected]> wrote: > > > @YuanSheng > > > > It may take about two days if only the `t/admin` > > > > > > > > > > On Sun, Oct 18, 2020 at 9:43 AM vincixu <[email protected]> wrote: > > > >> Vote for option 2. > >> The future goal is to gradually weaken AdminAPI, so it would be better > for > >> ManagerAPI not to be affected by history > >> > >> YuanSheng Wang <[email protected]> 于2020年10月16日周五 下午7:17写道: > >> > >> > For APISIX test cases, most of them are E2E tests. We will discard the > >> Lua > >> > version of the Admin API later. > >> > > >> > So I think that after switching to the Golang version of the Admin > API, > >> I > >> > have to update the old test cases of APISIX. > >> > > >> > @JunXu Chen > >> > > >> > How long would it take if all test cases under "t/admin" were > >> > re-implemented with the Golang way? > >> > > >> > On Fri, Oct 16, 2020 at 5:57 PM Zexuan Luo <[email protected]> > >> wrote: > >> > > >> > > I vote for the second one. We can hide the details in the test > >> helpers. > >> > > > >> > > JunXu Chen <[email protected]> 于2020年10月16日周五 上午9:08写道: > >> > > > >> > > > Hi, community, > >> > > > > >> > > > what do you think ? > >> > > > > >> > > > On Fri, Oct 16, 2020 at 9:05 AM JunXu Chen <[email protected]> > >> > wrote: > >> > > > > >> > > > > Recently, Vinci and I are refactoring the `manager api` for > Apache > >> > > APISIX > >> > > > > dashboard, to remove the dependency on MySQL, and that will > write > >> > data > >> > > to > >> > > > > ETCD directly. > >> > > > > > >> > > > > We have completed the main work. > >> > > > > > >> > > > > Yesterday I tried to use the test cases in the `t/admin` dir of > >> > Apache > >> > > > > APISIX to test the refactored `manager api`. > >> > > > > Many use cases failed because they tested the response status > code > >> > and > >> > > > > response body. > >> > > > > The status code can be maintained the same, but the response > body > >> is > >> > > > > difficult, especially the error message, because a lot of this > >> > > > information > >> > > > > comes from third-party libraries, such as `jsonschme`. > >> > > > > > >> > > > > I think it’s time to discuss how to develop and test between > >> `manager > >> > > > api` > >> > > > > and APISIX > >> > > > > > >> > > > > The main issue is how to test to ensure that the data is correct > >> > > between > >> > > > > APISIX and `manager api`. > >> > > > > Especially in the development process, when the data schema > needs > >> to > >> > be > >> > > > > changed. > >> > > > > > >> > > > > There are currently two ideas. > >> > > > > > >> > > > > 1. Share test cases > >> > > > > This method guarantees the correctness of the data to the > greatest > >> > > > extent, > >> > > > > but it is more complicated (we need to make a lot of > >> modifications to > >> > > the > >> > > > > old use cases, and the two projects need to pull each other's > code > >> > for > >> > > > > cooperation testing) and the two projects are relatively > coupled. > >> > > > > > >> > > > > 2. Agreed on a schema and test separately > >> > > > > This method is relatively simple, and the two projects can also > be > >> > > > > decoupled. But it is not so restrictive. > >> > > > > > >> > > > > >> > > > >> > > >> > > >> > -- > >> > > >> > *MembPhis* > >> > My GitHub: https://github.com/membphis > >> > Apache APISIX: https://github.com/apache/apisix > >> > > >> > > >
