amazon-ecs-agent icon indicating copy to clipboard operation
amazon-ecs-agent copied to clipboard

engine: skip some tests on Mac

Open nodir-t opened this issue 2 years ago • 2 comments

Summary

Building a CNI configuration is supported only on Linux and Windows. On other platforms, it fails with "unsupported platform": https://github.com/aws/amazon-ecs-agent/blob/05730614021c70c7f39d7cc00264aaffc5b5b0d3/agent/api/task/task_unsupported.go#L96-L100

However, 3 tests in engine package that rely on CNI are not skipped on other platforms.

Implementation details

Skip the impacted tests by checking GOOS in runtime. Do not use build tags because there are other tests in the same file that pass.

Testing

cd agent
go test -tags unit ./engine

New tests cover the changes: no

Description for the changelog

engine: skip some tests on Mac

Licensing

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

nodir-t avatar Apr 14 '22 21:04 nodir-t

Hmm, wonder if we should avoid returning an error in task_unsupported.go instead. I think it's safe to do that since we're not building binaries for unsupported platforms anyways.

angelcar avatar Apr 15 '22 16:04 angelcar

@fierlion let's decide to close or merge this PR

nodir-t avatar Aug 11 '22 07:08 nodir-t

closing for now -- will reopen as part of future work

fierlion avatar Aug 23 '22 23:08 fierlion