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

GrpcChannel tests not working anymore #172

Closed
rapgenic opened this issue Oct 29, 2020 · 7 comments · Fixed by #177
Closed

GrpcChannel tests not working anymore #172

rapgenic opened this issue Oct 29, 2020 · 7 comments · Fixed by #177
Assignees
Labels
bug Something isn't working grpc QtGrpc related issues

Comments

@rapgenic
Copy link
Contributor

Hi @semlanik,

while testing the new commits I noticed that the tests I wrote aren't working anymore and I suspect the cause is the removal of the following lines from the tests/test_grpc/CMakeLists.txt

if (QT_PROTOBUF_NATIVE_GRPC_CHANNEL)
    target_compile_definitions(qtgrpc_test PRIVATE QT_PROTOBUF_NATIVE_GRPC_CHANNEL)
    target_compile_definitions(qtgrpc_secure_test PRIVATE QT_PROTOBUF_NATIVE_GRPC_CHANNEL)
endif()

That happened on commit: facaba6

@rapgenic rapgenic added the bug Something isn't working label Oct 29, 2020
@rapgenic
Copy link
Contributor Author

Another thing I discovered is that the CI does not automatically run the tests with the flag QT_PROTOBUF_NATIVE_GRPC_CHANNEL. I don't know how the CI works, so I'm only reporting it to you

@semlanik
Copy link
Owner

semlanik commented Oct 30, 2020

Hi @rapgenic ,

I added public compile definition to QtGrpc, that should work. Let me check first. I didn't enable these tests on CI because at some point travis start exit by timeout. For sanity check I probably will omit QT_PROTOBUF_NATIVE_GRPC_CHANNEL for now. But for master branch will enable it after some timing tests. Thanks!

@semlanik
Copy link
Owner

semlanik commented Oct 30, 2020

@rapgenic I checked locally seems QT_PROTOBUF_NATIVE_GRPC_CHANNEL works as expected and I see tests passed. Did you enable QT_PROTOBUF_NATIVE_GRPC_CHANNEL in your build setup? Keep in mind that I made this CMake property cached and it might not be enabled without reconfiguration.

@rapgenic
Copy link
Contributor Author

rapgenic commented Nov 3, 2020

@semlanik,

It seems that my system is the problem, even though I cannot identify what it is...

I'll try to investigate a bit more but right now I have no clue.

@rapgenic
Copy link
Contributor Author

rapgenic commented Nov 4, 2020

I found something quite strange using cmake watch_variable:

the value of QT_PROTOBUF_NATIVE_GRPC_CHANNEL changed when building tests, because the find_package call loaded the QtProtobufProjectConfig.cmake file from another project in a different folder, that includes qtprotobuf, where that variable actually has a different value...

How is it possible? Is there any form of caching outside the local build folder?

@rapgenic
Copy link
Contributor Author

rapgenic commented Nov 4, 2020

Ok I think I might have found the problem.

I observed that deleting the ~/.cmake folder allowed me to build again everything without error. According to cmake's help (https://cmake.org/cmake/help/v3.9/manual/cmake-packages.7.html#id21) in that folder are registered the user packages that are published with the export function.

Qtprotobuf actually uses this function to export itself as a package, and I think that after building it in another place, it registered itself as the qtprotobuf package, so when building the tests in another location, find_package does not include the local version of the library, but instead the other one which might be anywhere else in the system with possibly a different configuration.

@semlanik
Copy link
Owner

semlanik commented Nov 5, 2020

Probably I should add if(TARGET ...) check before find_package in tests and examples.

semlanik added a commit that referenced this issue Nov 12, 2020
- Add check for local targets for examples and tests
- Make microjson build explicitly static

Fixes: #172
semlanik added a commit that referenced this issue Nov 17, 2020
- Add check for local targets for examples and tests
- Make microjson build explicitly static

Fixes: #172
semlanik added a commit that referenced this issue Dec 14, 2020
- Add check for local targets for examples and tests
- Rename test helper file
- Refactor test helper functions and add extra helpers for
  examples
- Replace global variable that hold protoparser.go by Generator target
  property

Fixes: #172
semlanik added a commit that referenced this issue Dec 15, 2020
- Add check for local targets for examples and tests
- Rename test helper file
- Refactor test helper functions and add extra helpers for
  examples
- Replace global variable that hold protoparser.go by Generator target
  property

Fixes: #172
semlanik added a commit that referenced this issue Dec 19, 2020
- Add check for local targets for examples and tests
- Rename test helper file
- Refactor test helper functions and add extra helpers for
  examples
- Replace global variable that hold protoparser.go by Generator target
  property

Fixes: #172
semlanik added a commit that referenced this issue Dec 19, 2020
- Add check for local targets for examples and tests
- Rename test helper file
- Refactor test helper functions and add extra helpers for
  examples
- Replace global variable that hold protoparser.go by Generator target
  property

Fixes: #172
semlanik added a commit that referenced this issue Dec 21, 2020
- Add check for local targets for examples and tests
- Rename test helper file
- Refactor test helper functions and add extra helpers for
  examples
- Replace global variable that hold protoparser.go by Generator target
  property

Fixes: #172
semlanik added a commit that referenced this issue Dec 21, 2020
- Add check for local targets for examples and tests
- Rename test helper file
- Refactor test helper functions and add extra helpers for
  examples
- Replace global variable that hold protoparser.go by Generator target
  property

Fixes: #172
semlanik added a commit that referenced this issue Dec 21, 2020
- Add check for local targets for examples and tests
- Rename test helper file
- Refactor test helper functions and add extra helpers for
  examples
- Replace global variable that hold protoparser.go by Generator target
  property

Fixes: #172
semlanik added a commit that referenced this issue Dec 21, 2020
- Add check for local targets for examples and tests
- Rename test helper file
- Refactor test helper functions and add extra helpers for
  examples
- Replace global variable that hold protoparser.go by Generator target
  property

Fixes: #172
semlanik added a commit that referenced this issue Dec 21, 2020
- Add check for local targets for examples and tests
- Rename test helper file
- Refactor test helper functions and add extra helpers for
  examples
- Replace global variable that hold protoparser.go by Generator target
  property

Fixes: #172
semlanik added a commit that referenced this issue Dec 21, 2020
- Add check for local targets for examples and tests
- Rename test helper file
- Refactor test helper functions and add extra helpers for
  examples
- Replace global variable that hold protoparser.go by Generator target
  property

Fixes: #172
semlanik added a commit that referenced this issue Dec 21, 2020
- Add check for local targets for examples and tests
- Rename test helper file
- Refactor test helper functions and add extra helpers for
  examples
- Replace global variable that hold protoparser.go by Generator target
  property

Fixes: #172
semlanik added a commit that referenced this issue Dec 21, 2020
- Add check for local targets for examples and tests
- Rename test helper file
- Refactor test helper functions and add extra helpers for
  examples
- Replace global variable that hold protoparser.go by Generator target
  property
- Enable well known types for windows
- Update CI rules for windows

Fixes: #172, #183, #12
semlanik added a commit that referenced this issue Dec 21, 2020
- Add check for local targets for examples and tests
- Rename test helper file
- Refactor test helper functions and add extra helpers for
  examples
- Replace global variable that hold protoparser.go by Generator target
  property
- Enable well known types for windows
- Update CI rules for windows

Fixes: #172, #183, #12
@semlanik semlanik added the grpc QtGrpc related issues label Apr 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working grpc QtGrpc related issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants