Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hbham-00072z-Of for pgadmin-hackers@arkaria.postgresql.org; Fri, 14 Jun 2019 08:29:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hbhal-0006Zf-JQ for pgadmin-hackers@arkaria.postgresql.org; Fri, 14 Jun 2019 08:29:47 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hbhal-0006ZY-1F for pgadmin-hackers@lists.postgresql.org; Fri, 14 Jun 2019 08:29:47 +0000 Received: from mail-io1-xd42.google.com ([2607:f8b0:4864:20::d42]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hbhai-0007ya-58 for pgadmin-hackers@postgresql.org; Fri, 14 Jun 2019 08:29:45 +0000 Received: by mail-io1-xd42.google.com with SMTP id s7so3893766iob.11 for ; Fri, 14 Jun 2019 01:29:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pgadmin.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=nBMtJW8zVR/mbx/MV0gfFDP9s/3xXgs1rgRJG8Gq44o=; b=hCZacepPCl0znqXppixQOuoczkYtBYxTFxBuxS8ad7Qgcp93AJY20gVQIa1U0aKhwW bCoRWpagitYW9z1vre8+lufqSKDVGNeC4Y5cCgeOACkkGe/x9EBil7+vwwteOFiBmudb 7luFiE0L9uIaOE7AdLuvsoYuveevffUT9ukd8Pg9B3qi6HrcifG7cUOO3P+L6+oUodNJ /eaogIZgmbg/ysgZmQUug1/RAPhDvZlqYBDvU6U9MZhCiU6eFNjp94A+6bCZtjwewt7G SO8vHBfN7LD8hBo2gNJKEOVEMyyuURxggSRLvuuCMXlxwKybecJ7dX/Fmp+rt9dnGPgx RYKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nBMtJW8zVR/mbx/MV0gfFDP9s/3xXgs1rgRJG8Gq44o=; b=d+lxeJId6jV4ANRbSv6SuJTWd9TgDREmw+oBfz4KDwHXtJhaqTKyEk8yOGyPLyFf55 I19maYm6EqXEJzBj0Wnbegl9i2f6INoh1iM0u7SFevwvBOHDk27IVzhNFFDmaVN0uKSb xco3H7nq8kPkiK4qEoxzRhjTbDvbTKR81KEssS/b8eGHUVNoRyjbk7l89guYjwkrwY9S LijEq5x9Q/TOYQD+kFUHC4vNGgIATevG85ihDaXMKcOiHUO4xvzu1odR2hWb6AQoJGOE MzPtltPANDv93GqV38FUXG1nuUfxMlM9IhZWrVJ6QmR4+Nv5+QecG6+IrKIFlmm0wvGd 15lQ== X-Gm-Message-State: APjAAAV3Xqj9IfDWRTTfWJkq9vWr6aPwDzufDwGk99iiDqJjap2Alcj6 ioS/Ztny7iFfrz3npwewsvPgEbe3pkXgZzZYmYGx7C518iKDYQ== X-Google-Smtp-Source: APXvYqypg1BbqCYCBFQXJxW+VUgZfxTc0AweFZ4NI4AQReziNvyogDZ7UTn1soZB7Wglsb4fID2HuUyu+SjNp3dAe0c= X-Received: by 2002:a5d:9d83:: with SMTP id 3mr53671369ion.65.1560500982985; Fri, 14 Jun 2019 01:29:42 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Dave Page Date: Fri, 14 Jun 2019 09:29:31 +0100 Message-ID: Subject: Re: [pgAdmin4][Patch]: Feature #4202 Implement new framework to test Reverse Engineering SQL To: Akshay Joshi Cc: pgadmin-hackers Content-Type: multipart/alternative; boundary="000000000000c33e57058b447285" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --000000000000c33e57058b447285 Content-Type: text/plain; charset="UTF-8" Hi On Thu, Jun 13, 2019 at 12:52 PM Akshay Joshi wrote: > Hi Hackers > > I have implemented the new test framework to test the Reverse Engineering > SQL. I have integrated it as a part of API/Regression test suite. It will > work when we run all the test cases or module wise test case. > > *How it works*: Attached patch contains the generic framework to read all > the JSON files from the *tests->version based (example 9.6_plus, 10_plus > or default) folder. *Run all the test scenarios present in the JSON file > in sequential order. > > Format of the JSON file is mentioned in > "web/pgadmin/browser/server_groups/servers/databases/casts/tests/default/test.json" > > For expected SQL we will have following two options: > > - Provide the expected sql in scenario itself as parameter *"expected_sql" > : ""*. > - Create a output file with any name in the same directory where the > JSON file resides and specify the parameter "*expected_sql_file": > ""* > > Attached patch contains both the above mentioned examples. > > Please review it. > Nice! A few comments: - The scenario name should be "Reverse Engineered SQL Test Cases" - After the scenario name is output, can we output a \n so the next line isn't appended to the name? - How do we run only the re_sql tests? I tried the obvious ways (e.g. python runtests.py --pkg regression.re_sql.tests.test_resql.ReverseEngineeringSQLTestCase) but got errors. Please add an example to web/regression/README. - Once we have a way to run these tests only, please add a "make check-resql" target to the Makefile. - Can the expected output be formatted in the JSON such that it doesn't use \n, but uses regular line breaks? That would make it easier to copy/paste. Thanks. -- Dave Page Blog: http://pgsnake.blogspot.com Twitter: @pgsnake EnterpriseDB UK: http://www.enterprisedb.com The Enterprise PostgreSQL Company --000000000000c33e57058b447285 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi

On Thu, Jun 13, 2019 at 12:52 PM Akshay= Joshi <akshay.joshi@en= terprisedb.com> wrote:
Hi Hackers

I have impleme= nted the new test framework to test the Reverse Engineering SQL. I have int= egrated it as a part of API/Regression test suite. It will work when we run= all the=C2=A0test cases or module wise test case.

How it works: Attached patch contains the generic framework to read= all the JSON files from the tests->version based (example 9.6_plus, = 10_plus or default) folder. Run all the test scenarios present in the J= SON file in sequential order.

Format of the JSON f= ile is mentioned in "<path_of_source>web/pgadmin/browser/server_= groups/servers/databases/casts/tests/default/test.json"

=
For expected SQL we will have following two options:
<= ul>
  • Provide the expected sql in scenario itself as parameter "ex= pected_sql" : "<SQL>".
  • Create a output= file with any name in the same directory where the JSON file resides and s= pecify the parameter "expected_sql_file": "<name of th= e file>"
  • Attached patch contains both t= he above mentioned examples.

    Please review it.

    Nice!

    A f= ew comments:

    - The scenario name should be "R= everse Engineered SQL Test Cases"
    - After the scenario name = is output, can we output a \n so the next line isn't appended to the na= me?
    - How do we run only the re_sql tests? I tried the obvious wa= ys (e.g.=C2=A0python runtests.py --pkg regression.re_sql.tests.test_resql.R= everseEngineeringSQLTestCase) but got errors. Please add an example to web/= regression/README.
    - Once we have a way to run these tests only, = please add a "make check-resql" target to the Makefile.
    - Can the expected output be formatted in the JSON such that it doesn'= t use \n, but uses regular line breaks? That would make it easier to copy/p= aste.

    Thanks.

    --
    Dave Page
    Blog: http://pgsnake.blogspot.comTwitter: @pgsnake

    EnterpriseDB UK: http://www.enterprisedb.com
    The Enterpris= e PostgreSQL Company
    --000000000000c33e57058b447285--