test-with-spanner
Run unit tests that require the Spanner emulator. Use this skill when the user wants to run tests in packages like satellite/metabase, satellite/metainfo, or any other tests that interact with Spanner. Automatically handles checking for and configuring the Spanner emulator
Installation
Pick a client and clone the repository into its skills directory.
Installation
About this skill
Run unit tests that require the Spanner emulator. Use this skill when the user wants to run tests in packages like satellite/metabase, satellite/metainfo, or any other tests that interact with Spanner. Automatically handles checking for and configuring the Spanner emulator environment.
How to use
Upewnij się, że binarka
spanner_emulatorjest dostępna w zmiennej PATH systemu. Jeśli nie, możesz również przekazać flagę-spanner-test-dbdo konfiguracji połączenia.Jeśli chcesz uruchomić konkretny test, podaj jego nazwę w argumentach. Skill automatycznie znajdzie pakiet zawierający test za pomocą grep i uruchomi go.
Jeśli chcesz uruchomić wszystkie testy w pakiecie, podaj tylko ścieżkę do pakietu (np.
./satellite/metabase).Przed uruchomieniem testu skill sprawdzi, czy zmienna środowiskowa
STORJ_TEST_SPANNERjest już ustawiona. Jeśli tak, test framework automatycznie ją wykorzysta. Jeśli nie, skill doda flagę-spanner-test-db 'run:spanner_emulator', która automatycznie zarządza cyklem życia emulatora.Emulator zostanie uruchomiony przed testami, połączenie będzie skonfigurowane dla każdego testu, a po zakończeniu emulator zostanie zatrzymany i oczyszczony.
Po wykonaniu testów skill wyświetli wyniki — które testy przeszły, które nie, oraz listę wszystkich podtestów. Jeśli testy się nie powiodą, możesz poprosić o pomoc w badaniu przyczyn błędów.