Separation of tests requiring network connection

Some of Bitrise CLI tests at require internet connection e.g. Test_TriggerParams in trigger_params_test.go.
It causes issues in networkless environments like this:

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?

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!

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.

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

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.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.