Re: [PATCH] First HTTP functional test of the RPC interface

2020-05-23 Thread Frédéric Mangano-Tarumi
Lukas Fleischer [2020-05-23 12:35:46 -0400] > On Sun, 12 Apr 2020 at 12:55:46, Frédéric Mangano-Tarumi wrote: > > --- > > aurweb/test/__init__.py | 0 > > aurweb/test/conftest.py | 51 + > > aurweb/test/test_rpc.py | 21 + > > aurweb/test/ws

Re: [PATCH] First HTTP functional test of the RPC interface

2020-05-23 Thread Lukas Fleischer
On Sat, 23 May 2020 at 12:58:32, Frédéric Mangano-Tarumi wrote: > I submitted this patch when we were considering porting the whole > PHP\u202fcode base to Python. However, if we instead port the code as we make > new features, then the new framework would provide testing tools without > requiring

Re: [PATCH] First HTTP functional test of the RPC interface

2020-05-23 Thread Lukas Fleischer
On Sun, 12 Apr 2020 at 12:55:46, Frédéric Mangano-Tarumi wrote: > Though barely useful in its current state, it shows how to integrate > pytest with SQLAlchemy and Werkzeug, providing a test framework for the > potential future Flask port, while actually testing the current PHP > implementation. >

Re: [PATCH] First HTTP functional test of the RPC interface

2020-04-17 Thread Frédéric Mangano-Tarumi
Filipe Laíns [2020-04-16 22:58:47 +0100] > On Sun, 2020-04-12 at 18:55 +0200, Frédéric Mangano-Tarumi wrote: > > +assert parts.path in ("", "/") > > Why a tuple? In Python, tuples are essentially immutable lists, and I think it’s a good practice to use immutable structures when they fit.

Re: [PATCH] First HTTP functional test of the RPC interface

2020-04-17 Thread Frédéric Mangano-Tarumi
Lukas Fleischer [2020-04-16 16:58:51 -0400] > On Wed, 15 Apr 2020 at 17:54:45, Frédéric Mangano-Tarumi wrote: > > When I run test/t2600-rendercomment.t and measure the time, it spends > > almost 8 seconds on setup.sh, then 3 seconds to actually run the tests. > > That\u2019s quite significant. > >

Re: [PATCH] First HTTP functional test of the RPC interface

2020-04-16 Thread Filipe Laíns
On Sun, 2020-04-12 at 18:55 +0200, Frédéric Mangano-Tarumi wrote: > Though barely useful in its current state, it shows how to integrate > pytest with SQLAlchemy and Werkzeug, providing a test framework for the > potential future Flask port, while actually testing the current PHP > implementation.

Re: [PATCH] First HTTP functional test of the RPC interface

2020-04-16 Thread Lukas Fleischer
On Wed, 15 Apr 2020 at 17:54:45, Frédéric Mangano-Tarumi wrote: > When I run test/t2600-rendercomment.t and measure the time, it spends > almost 8 seconds on setup.sh, then 3 seconds to actually run the tests. > That\u2019s quite significant. > > $ ./t2600-rendercomment.t | ts -s %.s > 0.10 St

Re: [PATCH] First HTTP functional test of the RPC interface

2020-04-15 Thread Frédéric Mangano-Tarumi
Lukas Fleischer [2020-04-15 17:06:15 -0400] > The new tests are going to require mock data in the database, too, > right? Do you intend to populate the database separately for each test? > Note that many tests require a common basic set of data, such as user > accounts and packages. If we want diff

Re: [PATCH] First HTTP functional test of the RPC interface

2020-04-15 Thread Lukas Fleischer
On Wed, 15 Apr 2020 at 08:44:44, Frédéric Mangano-Tarumi wrote: > Lukas Fleischer [2020-04-15 08:08:08 -0400] > > Our test suite already uses a separate configuration which is > > auto-generated in test/setup.sh, so it is already self-contained in that > > sense; we only need to update aur_location

Re: [PATCH] First HTTP functional test of the RPC interface

2020-04-15 Thread Frédéric Mangano-Tarumi
Lukas Fleischer [2020-04-15 08:08:08 -0400] > Our test suite already uses a separate configuration which is > auto-generated in test/setup.sh, so it is already self-contained in that > sense; we only need to update aur_location there. I’m hesitant about using setup.sh because it does more than we

Re: [PATCH] First HTTP functional test of the RPC interface

2020-04-15 Thread Lukas Fleischer
On Tue, 14 Apr 2020 at 09:49:06, Frédéric Mangano-Tarumi wrote: > My bad, you\u2019re right. I had changed it following the TESTING > instructions. aur_location is clearly the variable to use, but in the > current state some people will miss it and the test suite would send > requests to production

Re: [PATCH] First HTTP functional test of the RPC interface

2020-04-14 Thread Frédéric Mangano-Tarumi
Lukas Fleischer [2020-04-14 09:36:11 -0400] > On Tue, 14 Apr 2020 at 09:26:44, Frédéric Mangano-Tarumi wrote: > > No way! aur_location refers to the development setup address. Its > > default value in our sample configuration is http://localhost:8080, > > which is fine. Note that in my first test I

Re: [PATCH] First HTTP functional test of the RPC interface

2020-04-14 Thread Lukas Fleischer
On Tue, 14 Apr 2020 at 09:26:44, Frédéric Mangano-Tarumi wrote: > Hi Lukas, > > Lukas Fleischer [2020-04-14 08:54:03 -0400] > > On Sun, 12 Apr 2020 at 12:55:46, Frédéric Mangano-Tarumi wrote: > > > +base_uri = aurweb.config.get("options", "aur_location") > > > +proxy = WsgiHttpProxy(base_u

Re: [PATCH] First HTTP functional test of the RPC interface

2020-04-14 Thread Frédéric Mangano-Tarumi
Hi Lukas, Lukas Fleischer [2020-04-14 08:54:03 -0400] > On Sun, 12 Apr 2020 at 12:55:46, Frédéric Mangano-Tarumi wrote: > > +base_uri = aurweb.config.get("options", "aur_location") > > +proxy = WsgiHttpProxy(base_uri) > > +return werkzeug.test.Client(proxy, Response) > > If I understa

Re: [PATCH] First HTTP functional test of the RPC interface

2020-04-14 Thread Lukas Fleischer
Hi Frédéric, Thanks for the work! My first thoughts below. On Sun, 12 Apr 2020 at 12:55:46, Frédéric Mangano-Tarumi wrote: > Though barely useful in its current state, it shows how to integrate > pytest with SQLAlchemy and Werkzeug, providing a test framework for the > potential future Flask port

[PATCH] First HTTP functional test of the RPC interface

2020-04-12 Thread Frédéric Mangano-Tarumi
Though barely useful in its current state, it shows how to integrate pytest with SQLAlchemy and Werkzeug, providing a test framework for the potential future Flask port, while actually testing the current PHP implementation. --- aurweb/test/__init__.py | 0 aurweb/test/conftest.py | 51 ++