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

Integration Tests #66

Open
cainthebest opened this issue Jul 10, 2023 · 4 comments · May be fixed by #121
Open

Integration Tests #66

cainthebest opened this issue Jul 10, 2023 · 4 comments · May be fixed by #121
Labels
enhancement New feature or request tests Anything regarding tests. v1.0.X Things about v1.0.X
Milestone

Comments

@cainthebest
Copy link
Member

I've been going through the test suite and noticed that it primarily consists of unit tests. While unit tests are invaluable for checking the functionality of individual components, I believe it would greatly benefit the library to also have a suite of integration tests.

Understanding how the library interacts with real game servers is essential, given that this is its primary application. Current unit tests do an excellent job of validating the standalone functions of the library, yet they fall short in shedding light on the dynamics between these functions in a live server context. In addition to this, having integration tests would significantly improve the quality of life for developers.

@Douile
Copy link
Collaborator

Douile commented Jul 10, 2023

+1

How do we validate whether an integration test has failed because the game server we used has gone down or if its the libraries fault?

I was thinking maybe me could use pseuso-servers that just always reply with a predetermined response we saved from a real server. But this requires work to implement and might defeat the entire purpose as it doesn't accurately reflect the current game engine (e.g. if a game update changed how queries work).

@CosminPerRam
Copy link
Member

I was thinking maybe me could use pseuso-servers that just always reply with a predetermined response we saved from a real server. But this requires work to implement and might defeat the entire purpose as it doesn't accurately reflect the current game engine (e.g. if a game update changed how queries work).

Yep, that leaves us with three options as I see it:

  1. Mock the response (make it static) and process it
  2. Find servers online and query them (or have a script for this that looks up servers!)
  3. Start our own servers (via docker for example)

I'm interested on the 2nd point, as the first one might not be that good and the third one would be very time and resource consuming.

@Douile
Copy link
Collaborator

Douile commented Jul 10, 2023

4th option hard code server addresses and if they break change them

@CosminPerRam
Copy link
Member

CosminPerRam commented Jul 10, 2023

4th option hard code server addresses and if they break change them

I've considered this to be the 2nd point.

If we choose this option, how would we test these servers? Just by querying and saying that it shouldnt be a GDError? An IP isn't always the same server (server properties can change and players are always changing, so no checking for names or counts). Could we rely on node-Gamedig for checking if the data is the same?

And also if we choose to find these dynamically (using a script) how would we do that? Although some servers (Valve ones for example) do have a master server, and we could search for those but many do not. Is there a game tracker that has an open api for stuff like this?

Providing 100% coverage of our games is impossible unless we start our own (3rd point).

@CosminPerRam CosminPerRam added enhancement New feature or request tests Anything regarding tests. labels Jul 10, 2023
@Douile Douile linked a pull request Oct 9, 2023 that will close this issue
@cainthebest cainthebest added the v1.0.X Things about v1.0.X label Sep 30, 2024
@cainthebest cainthebest added this to the v1.0.0 milestone Sep 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request tests Anything regarding tests. v1.0.X Things about v1.0.X
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants