You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apisix.apache.org by JunXu Chen <ch...@apache.org> on 2020/10/16 01:05:26 UTC

[DISCUSS] Dev and test issues after `manager api` refactored

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.

Re: [DISCUSS] Dev and test issues after `manager api` refactored

Posted by YuanSheng Wang <me...@apache.org>.
> It may take about two days if only the `t/admin`

that's good. I think we can do this first, confirming that the new "admin
api" can basically be used for APISIX.

after this, we will update all of the test cases one by one.

I think the option `2` is better too.


On Sun, Oct 18, 2020 at 6:15 PM Zexuan Luo <sp...@apache.org> wrote:

> 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 <ch...@apache.org> 于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 <ch...@apache.org> wrote:
> >
> > > @YuanSheng
> > >
> > > It may take about two days if only the `t/admin`
> > >
> > >
> > >
> > >
> > > On Sun, Oct 18, 2020 at 9:43 AM vincixu <vi...@apache.org> 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 <me...@apache.org> 于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 <sp...@apache.org>
> > >> wrote:
> > >> >
> > >> > > I vote for the second one. We can hide the details in the test
> > >> helpers.
> > >> > >
> > >> > > JunXu Chen <ch...@apache.org> 于2020年10月16日周五 上午9:08写道:
> > >> > >
> > >> > > > Hi, community,
> > >> > > >
> > >> > > > what do you think ?
> > >> > > >
> > >> > > > On Fri, Oct 16, 2020 at 9:05 AM JunXu Chen <
> chenjunxu@apache.org>
> > >> > 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
> > >> >
> > >>
> > >
> >
>


-- 

*MembPhis*
My GitHub: https://github.com/membphis
Apache APISIX: https://github.com/apache/apisix

Re: [DISCUSS] Dev and test issues after `manager api` refactored

Posted by Zexuan Luo <sp...@apache.org>.
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 <ch...@apache.org> 于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 <ch...@apache.org> wrote:
>
> > @YuanSheng
> >
> > It may take about two days if only the `t/admin`
> >
> >
> >
> >
> > On Sun, Oct 18, 2020 at 9:43 AM vincixu <vi...@apache.org> 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 <me...@apache.org> 于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 <sp...@apache.org>
> >> wrote:
> >> >
> >> > > I vote for the second one. We can hide the details in the test
> >> helpers.
> >> > >
> >> > > JunXu Chen <ch...@apache.org> 于2020年10月16日周五 上午9:08写道:
> >> > >
> >> > > > Hi, community,
> >> > > >
> >> > > > what do you think ?
> >> > > >
> >> > > > On Fri, Oct 16, 2020 at 9:05 AM JunXu Chen <ch...@apache.org>
> >> > 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
> >> >
> >>
> >
>

Re: [DISCUSS] Dev and test issues after `manager api` refactored

Posted by JunXu Chen <ch...@apache.org>.
@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 <ch...@apache.org> wrote:

> @YuanSheng
>
> It may take about two days if only the `t/admin`
>
>
>
>
> On Sun, Oct 18, 2020 at 9:43 AM vincixu <vi...@apache.org> 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 <me...@apache.org> 于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 <sp...@apache.org>
>> wrote:
>> >
>> > > I vote for the second one. We can hide the details in the test
>> helpers.
>> > >
>> > > JunXu Chen <ch...@apache.org> 于2020年10月16日周五 上午9:08写道:
>> > >
>> > > > Hi, community,
>> > > >
>> > > > what do you think ?
>> > > >
>> > > > On Fri, Oct 16, 2020 at 9:05 AM JunXu Chen <ch...@apache.org>
>> > 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
>> >
>>
>

Re: [DISCUSS] Dev and test issues after `manager api` refactored

Posted by JunXu Chen <ch...@apache.org>.
@YuanSheng

It may take about two days if only the `t/admin`




On Sun, Oct 18, 2020 at 9:43 AM vincixu <vi...@apache.org> 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 <me...@apache.org> 于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 <sp...@apache.org>
> wrote:
> >
> > > I vote for the second one. We can hide the details in the test helpers.
> > >
> > > JunXu Chen <ch...@apache.org> 于2020年10月16日周五 上午9:08写道:
> > >
> > > > Hi, community,
> > > >
> > > > what do you think ?
> > > >
> > > > On Fri, Oct 16, 2020 at 9:05 AM JunXu Chen <ch...@apache.org>
> > 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
> >
>

Re: [DISCUSS] Dev and test issues after `manager api` refactored

Posted by vincixu <vi...@apache.org>.
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 <me...@apache.org> 于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 <sp...@apache.org> wrote:
>
> > I vote for the second one. We can hide the details in the test helpers.
> >
> > JunXu Chen <ch...@apache.org> 于2020年10月16日周五 上午9:08写道:
> >
> > > Hi, community,
> > >
> > > what do you think ?
> > >
> > > On Fri, Oct 16, 2020 at 9:05 AM JunXu Chen <ch...@apache.org>
> 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
>

Re: [DISCUSS] Dev and test issues after `manager api` refactored

Posted by YuanSheng Wang <me...@apache.org>.
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 <sp...@apache.org> wrote:

> I vote for the second one. We can hide the details in the test helpers.
>
> JunXu Chen <ch...@apache.org> 于2020年10月16日周五 上午9:08写道:
>
> > Hi, community,
> >
> > what do you think ?
> >
> > On Fri, Oct 16, 2020 at 9:05 AM JunXu Chen <ch...@apache.org> 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

Re: [DISCUSS] Dev and test issues after `manager api` refactored

Posted by Zexuan Luo <sp...@apache.org>.
I vote for the second one. We can hide the details in the test helpers.

JunXu Chen <ch...@apache.org> 于2020年10月16日周五 上午9:08写道:

> Hi, community,
>
> what do you think ?
>
> On Fri, Oct 16, 2020 at 9:05 AM JunXu Chen <ch...@apache.org> 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.
> >
>

Re: [DISCUSS] Dev and test issues after `manager api` refactored

Posted by JunXu Chen <ch...@apache.org>.
Hi, community,

what do you think ?

On Fri, Oct 16, 2020 at 9:05 AM JunXu Chen <ch...@apache.org> 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.
>