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

write tests #1

Open
derhuerst opened this issue Sep 17, 2024 · 2 comments
Open

write tests #1

derhuerst opened this issue Sep 17, 2024 · 2 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@derhuerst
Copy link
Member

Currently, there is neither an integration test (testing against fixtures or a mock VDV system) nor an end-to-end test (testing against a real VDV system). Given that the VDV-453/-454 specs are quite complex, we should really have tests to prevent regressions!

@derhuerst derhuerst added enhancement New feature or request help wanted Extra attention is needed labels Sep 17, 2024
@dancesWithCycles
Copy link

Hi,
I could provide test messages. E.g.:

<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<DatenAbrufenAntwort>
        <Bestaetigung Zst="2024-06-18T08:59:58.449+02:00" Ergebnis="ok" Fehlernummer="0" />
        <WeitereDaten>false</WeitereDaten>
        <AUSNachricht AboID="1">
                <IstFahrt Zst="2024-06-18T08:59:58.390+02:00">
                        <LinienID>30</LinienID>
                        <RichtungsID>1</RichtungsID>
                        <FahrtRef>
                                <FahrtID>
                                        <FahrtBezeichner>VHP24438-23</FahrtBezeichner>
                                        <Betriebstag>2024-06-18</Betriebstag>
                                </FahrtID>
                                <FahrtStartEnde>
                                        <StartHaltID>de:03252:8000:4:8003</StartHaltID>
                                        <Startzeit>2024-06-18T08:32:00+02:00</Startzeit>
                                        <EndHaltID>de:03252:3690:0:1</EndHaltID>
                                        <Endzeit>2024-06-18T09:07:00+02:00</Endzeit>
                                </FahrtStartEnde>
                        </FahrtRef>
                        <Komplettfahrt>false</Komplettfahrt>
                        <IstHalt>
                                <HaltID>de:03252:3120:1:1</HaltID>
                                <Abfahrtszeit>2024-06-18T08:59:00+02:00</Abfahrtszeit>
                                <IstAbfahrtPrognose>2024-06-18T08:59:55+02:00</IstAbfahrtPrognose>
                                <IstAnkunftPrognose>2024-06-18T08:59:55+02:00</IstAnkunftPrognose>
                                <IstAbfahrtPrognoseStatus>Prognose</IstAbfahrtPrognoseStatus>
                                <IstAnkunftPrognoseStatus>Real</IstAnkunftPrognoseStatus>
                        </IstHalt>
                        <IstHalt>
                                <HaltID>de:03252:3110:0:1</HaltID>
                                <Abfahrtszeit>2024-06-18T09:00:00+02:00</Abfahrtszeit>
                                <IstAbfahrtPrognose>2024-06-18T09:00:55+02:00</IstAbfahrtPrognose>
                                <IstAnkunftPrognose>2024-06-18T09:00:55+02:00</IstAnkunftPrognose>
                                <IstAbfahrtPrognoseStatus>Prognose</IstAbfahrtPrognoseStatus>
                                <IstAnkunftPrognoseStatus>Prognose</IstAnkunftPrognoseStatus>
                        </IstHalt>
                        <LinienText>30</LinienText>
                </IstFahrt>
        </AUSNachricht>
</DatenAbrufenAntwort>

Do you have a test procedure in mind like unit testing where each message type is tested as a unit test?

@derhuerst
Copy link
Member Author

Hey @dancesWithCycles 👋

Do you have a test procedure in mind like unit testing where each message type is tested as a unit test?

I don't think many per-message-type unit tests will be a good trade-off, given that

  • XML parsing is done by a third-party lib, and the resulting JSON trees passed as-is;
  • most complexity (and therefore the most likely source of bugs) is in
    • the state handling – we can write more detailed tests for this;
    • the mismatch between vdv-453-client's and the server's assumptions about how VDV-453/-454 works.

However, having ~1 integration test per service that also tests (at least in a shallow way) if the messages get parsed correctly sounds like a good trade-off to me.

I could provide test messages. E.g. [this AUSNachricht one]

These messages will help make vdv-453-client make more compatible with non-VBB systems! 🙌

However, just to make sure: You're talking about a VDV-453 v2.3.2b (although I've seen quite some confusion and handwaving about the versions) & VDV-454 v2.2.1 system?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants