ZyorTaelon / eveapi

Java library for communicating with the eve online XML API
GNU Lesser General Public License v3.0
12 stars 8 forks source link

Online Tests #50

Closed burberius closed 8 years ago

burberius commented 9 years ago

We should create some online test, to verify all endpoints still exist and the fields are all valid. Therefore we will need a Corp and a Character API. I will ask in the Slack Devfleet channel if there exists an official one.

The online test should be executed as non default profile only. This can be done in the CI builds.

burberius commented 9 years ago

There is no public API key for testing. :-( I'll try to create a trial account and also create a "demo" corp for that.

ZyorTaelon commented 9 years ago

Problem with a trail account is that it only lasts a limited time. It would really only work with an alt character on an existing account that'll stay active for a long long time. On 18 May 2015 13:09, "Jens Oberender" notifications@github.com wrote:

There is no public API key for testing. :-( I'll try to create a trial account and also create a "demo" corp for that.

— Reply to this email directly or view it on GitHub https://github.com/ZyorTaelon/eveapi/issues/50#issuecomment-103019560.

burberius commented 9 years ago

From Devfleet: (13:07:23) luciadenniard: you can still use the API key when unsubbed

ZyorTaelon commented 9 years ago

Ok worth a shot. On 18 May 2015 13:12, "Jens Oberender" notifications@github.com wrote:

From Devfleet: (13:07:23) luciadenniard: you can still use the API key when unsubbed

— Reply to this email directly or view it on GitHub https://github.com/ZyorTaelon/eveapi/issues/50#issuecomment-103019937.

Marcon commented 9 years ago

Well... I can make api key for you, guys, on my cyno alt(and make corporation for it).

burberius commented 9 years ago

That would be so great! But keep in mind we would need a full API key, so we can test all endpoints.

Marcon commented 9 years ago

Yes. Full api, but it will be limited to one character on account(I can't make other characters on account public). And full api for test corporation.

burberius commented 9 years ago

Only a single character would be fine! Could you post them here? Then I will start on some online integration tests, when I find the time.

Marcon commented 9 years ago

KeyID: 4428355 vCode: Efnyja8S6pawB4EzefgZBFLDWGGTv0U9RZTfC6bD3vZ1pIc45FdgOUiCL6bpEssm

In ~5 minutes i train corporation management on this alt, make new corporation an then i will post corporation key

Update. Corporation key. KeyID: 4428366 vCode: 5TDpVttAXfTtJhWvPYKZnVfwIZPj8kAIDGa3YzP3MlVRwa2pYI6KP2qXBZseSoKa

Marcon commented 9 years ago

Fell free convo/mail character Kasarch ingame, if you need some actions with keys or test corporation.

burberius commented 8 years ago

With online test, we would have found #58 ...

burberius commented 8 years ago

Here is some example, how I did the online tests in my eve-crest API, then they could be run with a maven profile: https://github.com/burberius/eve-crest/blob/master/pom.xml#L135

GoldenGnu commented 8 years ago

I have started coding this.

Some of the API calls can not be tested with Marcon's keys, because they return empty results (The contracts API, for example). I will post the full list when I have it.

Marcon commented 8 years ago

@GoldenGnu Well i can make some contracts for test character and corporation, but it be finished contract. If you need some actions with test character - tell me, what you need.

GoldenGnu commented 8 years ago

@Marcon I will post the full list here when I have finished all the tests. I'm slowly working my way through all the API calls. I don't have a lot of time to work on it each day, so, it will take some time to complete everything.

Even small changes to the char/corp will invalidates existing online test. So, I prefer adding everything missing in one go and then fixing all the tests. Then the char/corp can be kept static.

GoldenGnu commented 8 years ago

@Marcon I finally finished the first stage of writing the tests; checking all the API calls for data.

I now have a list of all the APIs that are missing data: http://pastebin.com/BrmZ9uW1 I realize it is a major task to add all the needed data in game... Some of the data may not be possible to add (like Alliance stuff) and some of the data may change too much to rely on for static testing. But, lets see how far we can get...

o7

burberius commented 8 years ago

Any news on that? I'm currently working on #58 and would like to use your code to add online tests for KillMails.

GoldenGnu commented 8 years ago

I was waiting for @Marcon to reply.

The only thing I have done so far is to created all the test classes to figure out what APIs was empty and then I pretty much gave up tbh, because half of them didn't return any data and the rest changed faster than I could write the tests.

I don't think it's doable, as a million things expire in the API after a while and then you have to go in game and create data and then fix all the tests.

burberius commented 8 years ago

Those online tests should not check the exact data, but test

I'll try to do an example with the KillMail Endpoint, perhaps I have to kill @Marcon alt for that. ;-)

GoldenGnu commented 8 years ago

That would be perfect. A working prototype would be of great help to finish this issue. I slowly started working on the tests today, just checking everything for null/zero. Of course, most of the test will fail, until the data is created in-game.

I still see two problems: 1) Detecting new fields may be hard (but, would be really awesome) 2) I think some fields can be valid and null (but, I'm not 100% sure)

Anyway, look forward to seeing your results :)

Marcon commented 8 years ago

Oh god. I forgot about that alt. Sorry guys, account with that alt currently not payed. I'm currently working on two big projects and have no time for eve.

GoldenGnu commented 8 years ago

No worries...

If I read the devblog right, they're going to make eve-online free to play in November (with restrictions), so, that should make the char and corp accessible again.

If needed I can provide a corp/char key to my alts for use until then.

GoldenGnu commented 8 years ago

I finished writing all the online tests. It simply test if the value is null or not for all fields of all classes. It can easily be extended to also check if String/Collection/Map are empty and Numbers are zero I'm currently trying to fix as many false positives as possible (a lot of values are allowed to be null). Then I will commit it to my fork.

All the test are never going to pass, but, I already found quite a few minor bugs.

burberius commented 8 years ago

I currently also write on online tests for my KillMail changes and use reflection to walk over the beans. I hope we can somehow merge our stuff together.

For detecting new fields, we could match the number of attributes in the handlers to the number of field of the destination object. I haven't added that yet.

GoldenGnu commented 8 years ago

Reflection is the way to go, that way the tests will always be up to date. I will update my tests with your code once you're done. :)

Detecting new fields would be really really great...

burberius commented 8 years ago

Done, see my last commit.

You can run the online tests with: mvn clean test -Ponline

burberius commented 8 years ago

Online tests are implemente now, some problems are left over. See #80

burberius commented 8 years ago

@Marcon Can you please update the character key to include the ChatChannel rights, could be there are some other unchecked rights, too.

Marcon commented 8 years ago

ChatChannel not available for corproration keys. Here key for character with enabled chat channels options id: 5669026 vcode: Ud0aGh79j4ugLNmBhct4o9cHjbzFOmoMkbemN0ZSolsDfX0JXpXob4OwUU9Dw4Hu

also on corporation key(you used it before) enabled bookmarks option

burberius commented 8 years ago

Thank you, I will integrate them tomorrow. So it looks like we are missing a bookmark endpoint, but perhaps it's in Crest...

Marcon commented 8 years ago

https://eveonline-third-party-documentation.readthedocs.io/en/latest/xmlapi/corporation/corp_bookmarks.html

burberius commented 8 years ago

I wonder what those should be good for. It would be nice if you could change them, delete old ones for example.

Marcon commented 8 years ago

Created new one. Also now this character going to jita using autopilot, so we have chance to get killmail for this character(not good chance, cause Stain is dead region)

UPD. Nope. Stain, Period Basis, Querios, Delve - no people, who wants to help us with killmail.

burberius commented 8 years ago

Updated key