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

Java e2e index controller #162

Merged
merged 23 commits into from
Jun 19, 2018
Merged

Java e2e index controller #162

merged 23 commits into from
Jun 19, 2018

Conversation

jenow
Copy link
Contributor

@jenow jenow commented Jun 13, 2018

What does this PR do ?

e2e tests for JAVA Index controller

How should this be manually tested?

cd internal/wrappers/features/java
gradle cucumber

Other changes

Bug fixe on index.mDelete

@jenow jenow self-assigned this Jun 13, 2018
@codecov-io
Copy link

codecov-io commented Jun 13, 2018

Codecov Report

Merging #162 into 1.x will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##              1.x     #162   +/-   ##
=======================================
  Coverage   89.02%   89.02%           
=======================================
  Files         244      244           
  Lines        4409     4409           
=======================================
  Hits         3925     3925           
  Misses        452      452           
  Partials       32       32

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 78df949...2c06040. Read the comment docs.

@jenow jenow added the blocked label Jun 13, 2018
@jenow jenow changed the title Java e2e index Java e2e index controller Jun 13, 2018
And the collection has a document with id 'mdelete-my-document-id'
And the collection has a document with id 'mdelete-my-document-id2'
When I delete the documents 'mdelete-my-document-id' and 'mdelete-my-document-id2'
And I count how many documents there is in the collection
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be the When step:
When I count how many documents there is in the collection

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why? I am testing the delete feature there so I say when I delete a document and I count then I should have documents

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because in the scenario, the step that allow you to check everything is working, is when you count the documents in the collection, and check that the number of documents is coherent with the expected number, considering the previous steps

And the collection has a document with id 'mdelete-my-document-id'
And the collection has a document with id 'mdelete-my-document-id2'
When I delete the documents 'mdelete-my-document-id' and 'mdelete-my-document-id42'
Then I count how many documents there is in the collection
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be the When step

And the collection has a document with id 'mdelete-my-document-id2'
When I delete the documents 'mdelete-my-document-id' and 'mdelete-my-document-id42'
Then I count how many documents there is in the collection
And I shall receive 1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be the Then step

And it has a collection 'delete-test-collection'
And the collection has a document with id 'mdelete-my-document-id'
And the collection has a document with id 'mdelete-my-document-id2'
When I delete the documents 'mdelete-my-document-id' and 'mdelete-my-document-id2'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In order to better see that we are working on document lists, the step could be written with actual list:
And I delete the following documents: [ 'mdelete-my-document-id', 'mdelete-my-document-id2' ]

@jenow jenow removed the blocked label Jun 18, 2018
Given Kuzzle Server is running
And there is no index called 'test-index'
When I create an index called 'test-index'
Then the index should exists
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exist

When I create an index called 'test-index'
Then the index should exists

Scenario: Create should return an error when the index already exists
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

exist

Given Kuzzle Server is running
And there is the indexes 'test-index' and 'test-index2'
When I delete the indexes 'test-index' and 'test-index2'
Then indexes 'test-index' and 'test-index2' doesn't exist
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't exist

Feature: Index controller

Scenario: Create should create an index
Given Kuzzle Server is running
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Question: shouldn't this "Given" test be a generic hook applied to all scenarios instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No because if we want to test the case where kuzzle is not running it would not be possible.
BUT I need to do something to share the kuzzle instance across all scenario. I will do this in another PR because I have to use a dependency called picocontainer and I have to do it everywhere

QueryOptions o = new QueryOptions();
o.setRefresh("wait_for");

k.getIndex().delete_(index, o);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't there a way to not add a trailing _ to that function name ? :-(

@alexandrebouthinon alexandrebouthinon merged commit 1178873 into 1.x Jun 19, 2018
@scottinet scottinet deleted the java-e2e-index branch June 19, 2018 14:23
@jenow jenow mentioned this pull request Sep 10, 2018
scottinet pushed a commit that referenced this pull request Sep 11, 2018
* fix

* deploy on bintray

* wip

* symbolic link of io/kuzzle/sdk to src/main/java

* clean io folder

* force ln

* dynamically load .so and publish on bintray according to the architecture

* fix path in Makefile

* fix mkdir

* execute gradlew with sh

* fix Makefile

* update readme

* fix readme

* change java.library.path of cucumber

* rename void_result to error_result

* remove io folder on clean

* build cpp build

* compile missing sources

* do a go get before making core

* compile right sources for cpp

* cpp sdk test: phase 0

* build cucumber-cpp as cmake external project

* removed cucumber.wire file

* added build script to build cpp e2e tests

* small fixes...debuging

* added cucumber.wire config file

* fix updateSelf

* fix return in getCurrentUser cpp

* change cucumber timeout

* raised cucumber 'invoke' timeout

* fixed build: fixed tests weren't building anymore

cucumber-cpp changed their build, introduicing the need for another
include path to ensure we can find new generated header CukeExport.hpp

* remove pointers type on KuzzleError

* fix tests

* new e2e scenarios

* e2e test on auth controller for java + fixes

* more passings tests

* e2e tests on realtime

* fix unit test

* build: workaround to avoid having to launch build twice

* tests: added logout test

* fix test.py

* fix test.py

* remove comments

* added dependencie to python-dev

* add python to the all rule

* update README

* fix readme

* Update README.md

* add C++11 deependencie

* add cppflags

* add cppflags

* remove libraries

* change meta

* fix Makefile

* add python-dev as dependency

* add -y to apt

* add python3-dev as dependency

* use pkg-config

* add g++6 as dependency

* add g++6 as dependency

* wip

* remove auto

* remove auto

* remove auto

* csharp sdk

* update readme

* add mono-mcs dependency

* Remove pointer type on KuzzleError (#153)

* remove pointers type on KuzzleError

* add namespace

* c# namespace

* c# namespace

* update test

* update Makefile

* fix Makefile

* feature files: split feature files by tested feature

* change module name

* Update kuzzlesdk.h

removed const long

* enhance clean rule

* finalize e2e test

* update README

* wip

* wip

* wip

* csharp sdk for windows

* fix Makefile

* added gradlew scripts

* fix Makefile

* fix Makefile

* wip

* fixes from PR comments

* java e2e tests with fixes

* fix unit test

* java e2e test on index controller

* Launch Java SDK tests on CodePipeline (#146)

* Launch Java SDK tests on CodePipeline

Add Continuous Integration with CodePipeline running E2E and Unit Tests
for all languages

To manually test this branch :

- Choose .codepipeline/builds/*.yml matching your machine architecture and
replay all the steps.
- Go check CodePipeline last build status and logs on AWS

Other :
- Fix paths in `internal/wrappers/features/run*.sh` for CI environment.


* Add helper scripts
* Update codepipeline config

* java e2e collection controller

* fix tests

* wip

* wip

* fixes from PR comments

* fixes from pr

* fix from pr's comment

* fix CMakeLists.txt

* typo

* add header

* Fix C++ test execution

* Fix typos in test scripts
* Automatically change the testing kuzzle hostname according to the test execution environment (CI / dev machine)
* Add README.md directives

Add Continuous Integration with CodePipeline running E2E and Unit Tests
for all languages

To manually test this branch :

- Choose .codepipeline/build*.yml matching your machine architecture and
replay all the steps.
- Go check CodePipeline last build status and logs on AWS

Other :
- Fix paths in `internal/wrappers/features/run*.sh` for CI environment.

fix kuzzleio/kuzzle-backlog#232

Merge remote-tracking branch 'origin/java-deploy' into test-automation

Merge remote-tracking branch 'origin/1.x' into test-automation

Merge remote-tracking branch 'origin/java-deploy' into test-automation

Merge remote-tracking branch 'origin/1.x' into test-automation

Update codepipeline config

Fix hostname in step defs c++

Fix

Limit resources use

fix tests script c++

* Java e2e index controller (#162)

* fixes from pr's comments

* fixes from pr's comments

* fixes from pr's comments

* update swig for travis

* update travis.yml

* update swig binary in Makefile

* update Makefile

* update Makefile

* update Makefile

* update Makefile

* update Makefile

* update Makefile

* update Makefile

* update Makefile

* run tests in docker

* fix makefile

* fix cpp build

* fix build cpp

* Java e2e collection controller (#163)

* java e2e collection controller

* fix from pr's comment

* fixes from pr's comments

* fixes from pr's comments

* fixes from pr's comments

* update swig for travis

* update travis.yml

* update swig binary in Makefile

* update Makefile

* update Makefile

* update Makefile

* update Makefile

* update Makefile

* update Makefile

* update Makefile

* update Makefile

* run tests in docker

* fix makefile

* fix makefile

* fix cpp build

* fix build cpp

* fix scenario

* Update Travis CI (#166)

* Update Travis CI

* Clean test.sh
* Process Isolation using Docker images
* Include Wrappers E2E Tests

* Remove containers kill

* Collection first and second scenario

* e2e test of realtime controller in cpp sdk (#168)

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* realtime e2e cpp

* fix memleak

* set refs to null

* comment content of kuzzle-sdk-steps

* fix

* fix

* fix

* KZL-114 : [C++] Index controller tests (#167)

* KZL-114 : [C++] Index controller tests
* Add regexp
* Put index steps in separate file
* Add BOOST_FAIL in exceptions

* Add steps for collection

* add running specific feature file

* pass options to create document

* update readme cpp sdk

* Updates for PR

* wip

* build for android

* add jar rule

* generate aar file including the so for arm abi

* wip

* fix return value for document controller (#171)

* wip

* add a max retry to connect

* Fix index#list to return the indexes list

* add java tests

* uncomment

* wip

* embed .so file in .jar file

* fix tests

* Fix collection tests

* Add document test (#170)

* wip

* wip

* wip

* fix mget

* remove debug

* remove debug

* uncomment

* Updates for PR

* remove reset of context values

* fix typo

* Add snapshot stage skeleton

* Add snapshot script and stage

* Improve travis.yml syntax

* Apply @scottinet requested changes

* build for android

* fix docker image name

* fix make java

* fix tests

* add gradlew

* fix tests

* add gradle

* fix tests

* fix tests

* Rename struct members for java getter/setter (#179)

* update copyright information

* rename docker image

* Change the type pf options.offline_mode (#180)

* add a mapping argument to existing collection.create methods

* oopsie

* Rename deprecated method ReplayQueue to PlayQueue (#182)

* Rename ReplayQueue to PlayQueue

* Replace --mount by -v (Docker)

* Fix functional tests

* typo

* Build android AAR SDK (#178)

* build for android

* add jar rule

* generate aar file including the so for arm abi

* build for android

* fix docker image name

* fix make java

* fix tests

* add gradlew

* fix tests

* add gradle

* rename docker image

* change build order

* working listener

* wrap document

* fix e2e tests

* fixes

* wrap Auth controller

* wrap collection controller

* typo

* typo

* Wrap Server controller for Android SDK (#189)

* wrap server controller

* add typemap for std::string*

* Add queryOptions when needed on Realtime controller's methods (#190)

* add queryOptions when needed in realtime controller

* added reference

* [KZL-275] Add Android build stage in Codepipeline

* Throw only possible exception in controller Index, Collection and Kuzzle object (#192)

* Add PluginImplementation + ExternalService errors

* WIP explicit exceptions

* Add explicit exceptions for Index, Collection and Kuzzle

* fix merge

* fix methods sig

* remove java templates

* [KZL-372] Add namespace kuzzleio for C structs (#187)

* [KZL-372] Fix namespace kuzzleio in C++

Co-Authored-By: Kévin Blondel <kblondel@kaliop.com>

* [KZL-372] Apply @scottinet requested changes

* [Fix] Change some char* to const char* (#194)

* [Fix] Change some char* to const char*

* Wrap Realtime controller for Android SDK (#191)

* add references to string parameters

* add queryOptions when needed in realtime controller

* added reference

* wrap realtime controller

* fix subscribe return value

* Wrap Listeners for android (#195)

* wrap EventListener

* wrap SubscribeListener

* wrap NotificationListener

* wrapped listeners

* fix test

* add namespace

* Remove autoconnect (#197)

* Remove connect from options struct

* Remove defaultIndex from options struct

* Remove default_index from destructors

* now use C++11

* port android listeners

* wrap of std::function

* fix C++ build

* update g++ to 4.9

* fix travis.yml

* add C++11 support to NDK compilation

* fix exceptions wrapping

* fix exceptions

* fix cpp tests

* use lambda in cpp tests and enable C++11 in cmake

* use lambda in e2e cpp tests

* fix tests

* Add custom WebviewClient (#196)

* add custom webviewclient

* pass Event as ref

* fix wrap

* fix wrap

* typemap for Event&

* remove unessessary code

* revert

* fix signatures

* fix signatures

* fix cpp test

* add

* fix from PR's comment

* use static_cast
@jenow jenow mentioned this pull request Jun 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants