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

Feature/Intergalactic Research Network #460

Merged

Conversation

rautamik
Copy link
Contributor

Feature #172

Changes:
Add function to get Intergalactic Research Network Research Lab level.
Add Intergalactic Research Network Research Lab level feature test.

@rautamik
Copy link
Contributor Author

Hi @lanedirt,

I have implemented "Intergalactic Research Network" logic and feature test.

For some reason some tests like testDispatchFleetColonizeEmptyPlanet fails when I increased the number of planets created for feature tests from 2 to 4 in order to be able to test with multiple planets. Do you have any idea what is the correlation between number of planets created on and AccountTestCase::dispatchFleet to succeed? The coordinates given to dispatchFleet are empty.

@lanedirt
Copy link
Owner

Hi @lanedirt,

I have implemented "Intergalactic Research Network" logic and feature test.

For some reason some tests like testDispatchFleetColonizeEmptyPlanet fails when I increased the number of planets created for feature tests from 2 to 4 in order to be able to test with multiple planets. Do you have any idea what is the correlation between number of planets created on and AccountTestCase::dispatchFleet to succeed? The coordinates given to dispatchFleet are empty.

Thanks for your time in implementing the logic!

Regarding your question: I checked the correlation between amount of colonies and some tests failing. After some digging I found out that certain existing tests such as colonisation tests assume the player has only 2 planets at the start of the test. This is important for the Astrophysics technology as this controls the max. amount of colonies a player can have.

As an example the test FleetDispatchColoniseTest::testDispatchFleetColonizeEmptyPlanet() sets the astrophysics to level 3 which would allow the user to have 1 planet + 2 colonies max. However with your change to give every test user 4 planets the astrophysics level is now too low and when the test tries to colonise an additional planet the user would have a total of 1 planet + 3 existing + 1 new (= 5 in total) while the user can only have 3 total with astrophysics level 3.

I think in this case it would be better if we refactor the test logic so every test can individually control how many colonies the user has at the start of the test instead of setting it globally in AccountTestCase. This will make it easier to add certain tests that require a different amount of colonies.

We could integrate that refactor in this PR, but as this increases the scope I'm also fine with merging this PR as-is and then fixing the failing tests with a refactor in a separate PR. Let me know what you think.

@rautamik
Copy link
Contributor Author

Thanks for looking into this issue and explaining what happens. It sounds a good idea to refactor the test logic to set the number of colonies per test. I can do it in this PR, no worries about the scope increasing. This is small PR anyways.

@rautamik
Copy link
Contributor Author

@lanedirt I ended up to a simple solution to pass amount of planets before test parent setup, what you think about it? Other possible solution could be to create and setup user in new function and call that one from every child after parent setup.

Btw, the failing FleetDispatchAttackTest test should be a flaky one.

@lanedirt
Copy link
Owner

Hi @rautamik,

Looks good to me, nice and simple. In the future we could always refactor this part if it's necessary, but for now since it works I'm happy 😄!

I'll merge the PR. Thanks again for your time and help in making OGameX feature-complete 🚀 !

@lanedirt lanedirt merged commit e4ba4b5 into lanedirt:main Nov 24, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants