diff --git a/.github/workflows/test_suite_windows.yml b/.github/workflows/test_suite_windows.yml index 1127e4faeac..96aae79b3f0 100644 --- a/.github/workflows/test_suite_windows.yml +++ b/.github/workflows/test_suite_windows.yml @@ -88,13 +88,75 @@ jobs: python -m pip install requests PyGithub scripts/packaging/publish_release.py --key=${{ secrets.GITHUB_TOKEN }} --repo=${{ github.repository }} --branch=${{ github.ref }} --commit=$(git log -1 --format='%H') --tag=${{ github.ref }} - uses: actions/upload-artifact@v4 - if: ${{ contains(github.event.pull_request.labels.*.name, 'test distribution') }} + if: ${{ contains(github.event.pull_request.labels.*.name, 'test suite') || contains(github.event.pull_request.labels.*.name, 'test distribution') }} with: name: build-${{ matrix.os }} path: | distribution/*.exe + test-suite: + needs: build + if: ${{ contains(github.event.pull_request.labels.*.name, 'test suite') }} + strategy: + matrix: + os: [windows-2019] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v3 + - name: Download Artifacts + uses: actions/download-artifact@v4 + with: + name: build-${{ matrix.os }} + path: artifact + - uses: msys2/setup-msys2@v2 + with: + update: false + - name: Install Visual Studio 10 and OpenJDK 18 + shell: powershell + run: | + choco install -y openjdk --version=18.0.2 + choco install -y visualcpp-build-tools + - name: Install Webots Compilation Dependencies + run: | + export PYTHON_INSTALLATION_FOLDER=/C/hostedtoolcache/windows/Python + export PYTHON_HOME=$PYTHON_INSTALLATION_FOLDER/3.11.`ls $PYTHON_INSTALLATION_FOLDER | grep '^3\.11\.[0-9]\+$' | cut -c6- | sort -n | tail -n1`/x64 + echo 'export JAVA_HOME=/C/Program\ Files/OpenJDK/`ls /C/Program\ Files/OpenJDK`' >> ~/.bash_profile + echo 'export PYTHON_HOME='$PYTHON_HOME >> ~/.bash_profile + echo 'export VISUAL_STUDIO_PATH="/C/Program Files (x86)/Microsoft Visual Studio/2017"' >> ~/.bash_profile + echo 'export INNO_SETUP_HOME="/C/Program Files (x86)/Inno Setup 6"' >> ~/.bash_profile + echo 'export PATH=$PYTHON_HOME:$PYTHON_HOME/Scripts:$GITHUB_WORKSPACE/msys64/mingw64/bin:$GITHUB_WORKSPACE/bin/node:/mingw64/bin:/usr/bin:$JAVA_HOME/bin:$PATH' >> ~/.bash_profile + export WEBOTS_HOME=$GITHUB_WORKSPACE + ./scripts/install/msys64_installer.sh --all + - name: Extract Webots + run: | + ./artifact/webots-*.exe //SUPPRESSMSGBOXES //VERYSILENT //NOCANCEL //NORESTART //ALLUSERS + - name: Set up Python 3.11 + uses: actions/setup-python@v4 + with: + python-version: 3.11 + - name: Install Software Renderer + uses: ssciwr/setup-mesa-dist-win@v2 + with: + version: '24.2.1' + build-type: 'release-mingw' + - name: Test + run: | + export WEBOTS_DISABLE_SAVE_SCREEN_PERSPECTIVE_ON_CLOSE=true + python scripts/packaging/update_urls.py $(git log -1 --format='%H') + export TESTS_HOME=$PWD # required by cache group in the test suite + export WEBOTS_HOME="/c/Program Files/Webots" + export PATH="${WEBOTS_HOME}/msys64/mingw64/bin:$PATH" + export WEBOTS_HOME_PATH=$PWD # required for tests to find Makefile.include + export BRANCH_HASH=$(git log -1 --format='%H') + export MESA_GL_VERSION_OVERRIDE=3.3 + export LIBGL_ALWAYS_SOFTWARE=true + python tests/test_suite.py + - name: Setup tmate session + if: ${{ failure() }} + uses: mxschmitt/action-tmate@v3 + with: + detached: true delete-artifacts: - needs: [build] + needs: [build, test-suite] if: ${{ always() && !contains(github.event.pull_request.labels.*.name, 'test distribution') && !contains(github.event.pull_request.labels.*.name, 'test webots build') }} strategy: matrix: diff --git a/projects/.gitattributes b/projects/.gitattributes new file mode 100644 index 00000000000..7cf76504658 --- /dev/null +++ b/projects/.gitattributes @@ -0,0 +1 @@ +*.hdr binary diff --git a/src/webots/gui/WbSingleTaskApplication.cpp b/src/webots/gui/WbSingleTaskApplication.cpp index 059d9dbdee6..067e05b45b6 100644 --- a/src/webots/gui/WbSingleTaskApplication.cpp +++ b/src/webots/gui/WbSingleTaskApplication.cpp @@ -231,10 +231,11 @@ void WbSingleTaskApplication::showSysInfo() const { // An OpenGL context is required there for the OpenGL calls like `glGetString`. // The format is QSurfaceFormat::defaultFormat() => OpenGL 3.3 defined in main.cpp. QOpenGLContext *context = new QOpenGLContext(); - context->create(); + if (!context->create()) + assert(false); QOpenGLFunctions *gl = context->functions(); // QOpenGLFunctions_3_3_Core cannot be initialized here on some systems like // macOS High Sierra and some Ubuntu environments. - + assert(gl); #ifdef _WIN32 const quint32 vendorId = WbSysInfo::gpuVendorId(gl); const quint32 rendererId = WbSysInfo::gpuDeviceId(gl); diff --git a/tests/api/controllers/supervisor_import_robot_node/supervisor_import_robot_node.c b/tests/api/controllers/supervisor_import_robot_node/supervisor_import_robot_node.c index 2553ab8f7cd..d19b237908e 100644 --- a/tests/api/controllers/supervisor_import_robot_node/supervisor_import_robot_node.c +++ b/tests/api/controllers/supervisor_import_robot_node/supervisor_import_robot_node.c @@ -25,7 +25,7 @@ int main(int argc, char **argv) { wb_robot_step(2 * TIME_STEP); // import robot object - FILE *fd = fopen("MyBot.txt", "rb"); + FILE *fd = fopen("MyBot.txt", "r"); char contents[4096]; const int n = fread(contents, 1, sizeof(contents), fd); fclose(fd); diff --git a/tests/test_suite.py b/tests/test_suite.py index dac4d398c09..705b45361c9 100755 --- a/tests/test_suite.py +++ b/tests/test_suite.py @@ -116,7 +116,7 @@ def setupWebots(): command = Command([webotsFullPath, '--sysinfo']) command.run() if command.returncode != 0: - raise RuntimeError('Error when getting the Webots information of the system') + raise RuntimeError('Error when getting the Webots information of the system: ' + command.output) webotsSysInfo = command.output.split('\n') return webotsFullPath, webotsVersion, webotsSysInfo, webotsEmptyWorldPath @@ -181,7 +181,7 @@ def generateWorldsList(groupName): # generate the list from the arguments if filesArguments: for file in filesArguments: - if f'/tests/{groupName}/' in file: + if (os.sep + 'tests' + os.sep + groupName + os.sep) in file: worldsList.append(file) # generate the list from 'ls worlds/*.wbt' @@ -201,13 +201,16 @@ def generateWorldsList(groupName): # speaker test not working on github action because of missing sound drivers # robot window and movie recording test not working on BETA Ubuntu 22.04 GitHub Action environment # billboard test not working in macos GitHub Action environment + # billboard and robot window not working on windows GitHub Action environment. if (not filename.endswith('_temp.wbt') and not ('GITHUB_ACTIONS' in os.environ and ( filename.endswith('speaker.wbt') or filename.endswith('local_proto_with_texture.wbt') or (filename.endswith('robot_window_html.wbt') and is_ubuntu_22_04) or (filename.endswith('supervisor_start_stop_movie.wbt') and is_ubuntu_22_04) or - (filename.endswith('billboard.wbt') and sys.platform == 'darwin') + (filename.endswith('billboard.wbt') and sys.platform == 'darwin') or + (filename.endswith('billboard.wbt') and sys.platform == 'win32') or + (filename.endswith('robot_window_html.wbt') and sys.platform == 'win32') ))): worldsList.append(filename)