Skip to content

Commit 3f8263e

Browse files
committed
Edit ci and fail test if not using latest ursim
1 parent 9792510 commit 3f8263e

File tree

3 files changed

+14
-9
lines changed

3 files changed

+14
-9
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ jobs:
5252
run: mkdir -p test_artifacts
5353
- name: test
5454
run: cd build && ctest --output-on-failure --output-junit junit.xml
55+
env:
56+
URSIM_VERSION: ${{matrix.env.URSIM_VERSION}}
5557
- name: Upload test results to Codecov
5658
if: ${{ !cancelled() }}
5759
uses: codecov/test-results-action@v1

tests/CMakeLists.txt

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,7 @@ if (INTEGRATION_TESTS)
2424

2525
find_package(Python3 COMPONENTS Interpreter REQUIRED)
2626

27-
add_custom_command(
28-
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/resources/exhaustive_rtde_output_recipe.txt
29-
COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/resources/generate_rtde_outputs.py
30-
BYPRODUCTS ${CMAKE_CURRENT_SOURCE_DIR}/resources/exhaustive_rtde_output_recipe.txt
31-
)
32-
33-
add_custom_target(generate_outputs ALL DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/resources/exhaustive_rtde_output_recipe.txt)
34-
27+
add_custom_target(generate_outputs ALL COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/resources/generate_rtde_outputs.py)
3528
add_executable(rtde_tests test_rtde_client.cpp)
3629
add_dependencies(rtde_tests generate_outputs)
3730
target_link_libraries(rtde_tests PRIVATE ur_client_library::urcl GTest::gtest_main)

tests/test_rtde_client.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,9 +377,19 @@ TEST_F(RTDEClientTest, check_all_rtde_output_variables_exist)
377377
{
378378
client_->init();
379379

380+
VersionInformation version = client_->getVersion();
381+
const char* env_var = std::getenv("URSIM_VERSION");
382+
std::string env(env_var);
383+
384+
if (env != "latest")
385+
{
386+
std::cout << "Incorrect URSIM version, it should be the latest version, version is: " << env << std::endl;
387+
GTEST_FAIL();
388+
}
389+
380390
// Ignore unknown output variables to account for variables not available in old urcontrol versions.
381391
client_.reset(new rtde_interface::RTDEClient(g_ROBOT_IP, notifier_, exhaustive_output_recipe_file_,
382-
input_recipe_file_, 0.0, true));
392+
input_recipe_file_, 0.0, false));
383393

384394
EXPECT_TRUE(client_->init());
385395
client_->start();

0 commit comments

Comments
 (0)