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

#187 Wrap test in subtest for go test runner #188

Merged
merged 2 commits into from Oct 27, 2022
Merged

#187 Wrap test in subtest for go test runner #188

merged 2 commits into from Oct 27, 2022

Conversation

fetinin
Copy link
Contributor

@fetinin fetinin commented Oct 17, 2022

Добавлено оборачивание каждого теста из .yaml файла в сабтест при запуске тестов через go test.
https://user-images.githubusercontent.com/16325204/196138717-e77d0f49-b4c2-49e3-a3b0-d4155aeef7b2.mov

Для корректной работы пришлось довольно сильно переделать исполнение теста в runner т.к. фактическое исполнение теста от начала до конца (включая вывод результатов) должен находиться внутри t.Run().

Код запуска теста стал чуть более сложным, но за счет разделения удалось унести код нужный только для запуска тестов через бинарь gonkey в console_runner.

После оборачивания тестов в t.Run() появился ещё один бонус. Теперь можно запускать конкретные gonkey-тесты через флаг -run. Например go test gonkey_test.go -v -test.run "^\QTestSubscriptions/6." запустит все тесты название которых начинается на 6..
https://user-images.githubusercontent.com/16325204/196148790-cf54bb68-ca11-480e-a8ce-10ec3ee2cfa6.mov

@fetinin fetinin merged commit 613a410 into master Oct 27, 2022
@fetinin fetinin deleted the subtest branch October 27, 2022 08:19
@github-actions
Copy link

🚀 PR was released in v1.19.0 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request minor release as minor released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Оборачивать каждый тест в сабтесты
2 participants