-
Notifications
You must be signed in to change notification settings - Fork 18
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
fix (webapi): sipi integration #340
Conversation
For integration tests, all standard testing tasks are available, but must be prefixed with 'it:', e.g., 'it:test' Further, the test need to be stored in the 'it' (and not 'test') folder. The standard source hierarchy is used, e.g., 'src/it/scala'
@tobiasschweizer The file upload should work now. Could you please check? You can now also use the brand new integration tests:
There is currently only one test written (create page with binary). |
I will look at it, thx. I adapted the error handling when parsing the Sipi error messages on the branch |
This is very nice! Could you tell me how to set up the Sipi info route? |
We should adapt Attention: |
Ah, yes, sorry. Forgot about that. It's a copy of
|
Lukas thinks that we should put the Sipi config files and Lua files in the Knora repository. |
We can create a |
I think that would make sense. In that directory we should put:
|
# Conflicts: # webapi/WebapiBuild.sbt
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If an InternalServerException is thrown during the processing of an integration test, the exception's stack trace should be logged to the console. I added a primitive test for this: ErrorV1ITSpec. It deliberately causes an InternalServerException. Can you please have a look at the logging configuration?
I have added the same test to our normal tests. The behaviour, i.e. output is the same. With
With
As far as I can tell, this error is thrown by Akka when we try to send What would you like to see as an error message? |
I'm confused now. I don't understand why there would be a 3cc9d28#diff-13eb43a5343d8a8f59b7bd0a75fa4350R70 So I think we should get an And I think we should get the stack trace of that exception on the console. |
It is not really |
OK, then I guess |
On second thought, I guess it can't check for |
What about all those cases, where a native type like |
OK. But accidentally writing a responder method that returns |
And would it help to put a |
Only if it is directly put into the
I just did, but it didn't catch the exception. I thing that there must be a way to check |
I will continue tomorrow. Enough for tonight. |
What happened was that we temporarily gave a method a return type of
Sleep well and don't dream about exceptions! :) |
This "fix" is catching this kind of error now. Not much inside the stack trace, but at least it is more visible. |
OK great! No need for If a responder returns a failed future containing an |
Also, since we have the type |
I've refactored it a bit. This way, we can add additional message types that should not be used. |
That looks good to me, but I'd like to see if it's possible to do this at compile time. I'm on the train, let me get back to you in a couple of hours. |
yep, we have (see latest commit) I don't like that we have test code inside the live responders. We should move this out of there. I have created an issue for this: #359. But I will leave this for next year. |
I figured out where the dfa030c#diff-b8a7a8584b59cc92476dc6235a5f7bb4R28 I don't know why, but I've run out of time to work on it. We can look at it in January. So what was happening is that So it turns out that Akka is happy to accept a message of type I refactored I changed all the responders so if they get an unexpected message, they call a function that handles it in a consistent way. |
OK I think I've fixed this now. I don't understand why, but it was this line in
Removing this line seems to make everything work as it should:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of requiring routes to wrap all request messages in futures, I added a method RouteUtilV1.runJsonRouteWithFuture
, which is only needed by two routes.
Please just remove the commented-out code in UsersResponderV1Spec
, then I think you can merge this.
@@ -68,36 +68,11 @@ class UsersResponderV1Spec extends CoreSpec() with ImplicitSender { | |||
|
|||
val mockUserProfileV1 = UserProfileV1(UserDataV1(lang, user_id, token, username, firstname, lastname, email, password), Nil, Nil) | |||
|
|||
/* |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove code rather than commenting it out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't I remove this already?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Jup, it's red :-)
Cool, thanks. I thought that there was something amiss with the whole thing, since I tried to replicate the error by sending a Why the logger is not instantiating, I have no idea. It's one of those things that will hopefully become apparent one day. |
* develop: (22 commits) fix (bug) default permissions removed feature (bibliography) resource Edition is added Display a compound resource without images (#358) User, Project, and Group Management (#299) fix (webapi): Handle request for nonexistent resource class. (#377) fix (biblio-onto) a bug in ontology is fixed fix (webapi): Fix permission checking on link values (#367) fix (limit incoming references): limit the number of incoming references (#365) fix (ontology responder): ignore knora-base:resourceProperty in ontology responder for property definitions (#362) fix (bibliography) the bug with comments of resources is fixed fix (webapi): sipi integration (#340) Don't redundantly traverse cycles in graph data query (#350) Optimise queries for GraphDB and refactor query optimisation (#336) Document deleteComment (#337) feature (beol), person is moved from Knora-base to bell ontology, comment is added to biblio resources. feature [bibliography] added the collection to books too feature [bibliography] the resources editor and organization are added commit [feature] the collectionArticle, journal Issue, and JournalArticle added feature (bibliography) subtitle is added to publication feature (bibliography): translation labels in it and fr, added doi for publication ...
resolves #291
resolves #339