aws-lambda-cpp icon indicating copy to clipboard operation
aws-lambda-cpp copied to clipboard

feat: add unit tests in ci

Open maxday opened this issue 1 year ago • 3 comments

Description of changes:

  • add latest version of gtest framework via CMakeLists.txt (1.15.2 as of today)
  • add a noop.dummy_test, as a first step for having unit tests in CI
  • update GitHub action workflow file to enable unit tests and run them
  • update .clang-tidy not to complain on external testing dependencies

Testing:

  • GitHub action CI is green when tests are passing Screenshot 2024-08-14 at 13 00 59
  • GitHub action CI is red when tests are failing Screenshot 2024-08-14 at 13 00 32

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

maxday avatar Aug 14 '24 12:08 maxday

@maxday why add a new unittest directory? There is already a test directory with a CMake file and all.

marcomagdy avatar Aug 14 '24 18:08 marcomagdy

@maxday why add a new unittest directory? There is already a test directory with a CMake file and all.

It seems to me that existing tests are integration tests (which requires a more complex infra to be able to run them with CodeBuild and the SDK). This new repo will contain unit tests, with an extremely fast feedback loop. This will help testing the runtime at the function level, without any third party integration. Does it make sense to you?

maxday avatar Aug 14 '24 18:08 maxday

Can you think of a way to combine both tests? That would help us use the same google-test library for both unit and integration tests. We can even use the same CMake file potentially with some flags to turn on/off the integration tests.

It's not ideal to we have two different sets of tests that use different versions of the testing library.

marcomagdy avatar Aug 14 '24 20:08 marcomagdy