Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Externalization of input PCMs for testing #1

Open
acherm opened this issue Nov 6, 2016 · 1 comment
Open

Externalization of input PCMs for testing #1

acherm opened this issue Nov 6, 2016 · 1 comment
Assignees

Comments

@acherm
Copy link
Collaborator

acherm commented Nov 6, 2016

The goal is to have a testing procedure that loads a PCM and controls that some operations/services are working well.

What is expected is that some PCMs pose some difficulties (e.g., no "product column") and numerous bugs in opencompare are indeed related to JS issues.

I've tried to use Karma and it works pretty well.

I've used openCompareEditorApp (and not openCompareEditor directly) to load a PCM.
We can then write some assertions.

What I don't like at the moment is that the PCM is hardcoded within openCompareEditorApp.
If we want to change it you have to copy and paster 1000 lines.
It's also weird to read.

Ideally the input test PCM should be externalized somewhere (in a local JSON file)

I've made some attempts:

  • specifying a JSON local file (see eg foopcm1.json), and then use $http angular for loading the PCM... it almost works but the asynchronous fetching code raises some issues. Basically the editor is loaded in the first place whereas the data is still not loaded
  • playing a bit with the openCompareServer service. It does work (you have to launch an opencompare Website with Play! first) but the solution is a little bit "fragile" (PCM ids may disappear for some reasons) and hard to deploy (you need an opencompare server).

Ideally the openCompareServer service should work with "local" PCM files (without a server)

Some additional notes:

  • Chrome can be used in addition to PhantomJS
  • Chrome can provide more detailed debugging messages
  • I deactivated Chrome (comment the line in karma.conf.js) because Travis then doesn't work (we need to specify the bin folder of Chrome, it seems a bit complicated at the moment)
@acherm acherm self-assigned this Nov 6, 2016
@acherm
Copy link
Collaborator Author

acherm commented Nov 8, 2016

Karma is now working with external JSON files.
Commit f2ba761
Data located in the "test" folder of app. I would like to put it outside "app" but that's not so easy.

Another possible improvement is as follows: grunt serveworks if you uncomment $scope.launchOCEditor().
That's normal but if you uncomment this line, then the testing fails because it first calls $scope.launchOCEditor() with a specific JSON.

Overall I have impression we should develop and maintain another HTML/JS file for "showcase" (serve) and "test"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant