Re: [patch] Refactor: clipboard, translations, jasmine

From: Dave Page <dpage(at)pgadmin(dot)org>
To: Atira Odhner <aodhner(at)pivotal(dot)io>
Cc: pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: [patch] Refactor: clipboard, translations, jasmine
Date: 2017-02-27 11:28:02
Message-ID: CA+OCxow-AavyX=rsZRtskgFTSNAKsyQuH0e-LX=L5ng-zDBAjQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Hi

On Fri, Feb 24, 2017 at 7:14 PM, Atira Odhner <aodhner(at)pivotal(dot)io> wrote:
> Hi hackers,
>
> We made some changes to start to make the javascript testable:
>
> - Move clipboard copying into its own file so we can test the
> interaction with it when we start adding column selection
> - Create a translations.js and translate.js which uses flask to pull in
> translations, but
> lets us have the flask template rendering confined to that one file,
> enabling us to test javascript files that rely on translations
> - add jasmine javascript testing which currently runs from the browser
> at /static/SpecRunner.html when the app is up.
> - delete some dead code from sqleditor.js
>
> Why we decided to make translate.js only support interpolations of the form
> "%(variable)s":
> - it matches functionality in python
> - having named variables allows for multiple interpolations in one
> sentence without the risk that a translation will swap the order

There are various issues with this patch:

- It needs to be broken up - one change, one patch. There are 4
distinct changes here, that each need to be reviewed on their own
merit.

- The changes to the translation mechanism need discussion. How will
it work? What do developers have to do differently? When will the
changes it allows be implemented?

- There are no doc updates corresponding to the changes to the
translation mechanism.

- What does the jasmine testing actually do? There are no doc or
README updates to describe it.

- There is no update to libraries.txt

- The jasmine code seems to be littered with cruft that we don't want
to be carrying in our repo. Can it be reduced to the bare minimum
CSS/JS files?

- Test code (including jasmine) needs to be isolated from the
application code, e.g. in a tests/ directory. Future versions of
pgAdmin will exclude the test suite code from their packaging.

> Future things we'd like to add to this:
> - make jasmine run from the commandline with the rest of the tests

I think that's a pre-requisite for any additional test functionality
at this point, given that we're moving to fully automated testing.

Thanks, Dave.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Ashesh Vashi 2017-02-27 11:53:00 PATCH: Javascript addons/modules specific to pgAdmin 4
Previous Message Dave Page 2017-02-27 10:49:51 pgAdmin 4 commit: Simplify runtime startup polling, and increase retrie