Separation of tests requiring network connection


#1

Some of Bitrise CLI tests at https://github.com/bitrise-io/bitrise/tree/master/_tests/integration require internet connection e.g. Test_TriggerParams in trigger_params_test.go.
It causes issues in networkless environments like this: https://github.com/gentoo/gentoo/pull/9345#issuecomment-411667582

For now I mitigated that issue by removing all the test files requiring network connection prior to starting tests. List of those files was created manually basing on which tests had failed. However, it is not an ideal solution. E.g. when new test files are added the list needs to be updated.

Is there any other recommended solution? E.g. it seems that go build tags can be used here. Or maybe all those tests are intended to run only in environment having network connectivity?


#2

Hi @koral,
Sorry for the delayed response! Thank you for your questions! I forwarded it to our tooling team and they’ll get back to you ASAP!


#3

Hey @koral!

You are right, these thing aren’t architected to run in a networkless environment, however it doesn’t seem to be a huge job to use an env, or something to separate network-requiring jobs.

Feel free to send a PR with the changes, at the same time I present this to the team to decide if we can prioritize to fix it sometimes.


#4

OK, thanks. I’ll try to do that in my freetime.


#5

Also worth to note that the tests you linked @koral are our integration tests, and those can be skipped if you’re OK with not running the integration tests just the unit tests.