Repository: fitbenchmarking/fitbenchmarking

Issue:
Windows tests fail due to requesting a relative path between drives
**Description of the error**
The windows tests fail during generating results when a relative path is requested between 2 locations on different drives.

**Describe the expected result**
Paths should be explicit in where they are relative too so this doesn't happen


Discussion:
github-actions[bot]: ## Unit & System Test Results
    4 files  ±0      4 suites  ±0   8m 22s [:stopwatch:](https://github.com/EnricoMi/publish-unit-test-result-action/blob/v1.20/README.md#the-symbols "duration of all tests") - 5m 13s
403 tests ±0  395 [:heavy_check_mark:](https://github.com/EnricoMi/publish-unit-test-result-action/blob/v1.20/README.md#the-symbols "passed tests") ±0    8 [:zzz:](https://github.com/EnricoMi/publish-unit-test-result-action/blob/v1.20/README.md#the-symbols "skipped / disabled tests") ±0  0 [:x:](https://github.com/EnricoMi/publish-unit-test-result-action/blob/v1.20/README.md#the-symbols "failed tests") ±0 
774 runs  ±0  721 [:heavy_check_mark:](https://github.com/EnricoMi/publish-unit-test-result-action/blob/v1.20/README.md#the-symbols "passed tests") ±0  53 [:zzz:](https://github.com/EnricoMi/publish-unit-test-result-action/blob/v1.20/README.md#the-symbols "skipped / disabled tests") ±0  0 [:x:](https://github.com/EnricoMi/publish-unit-test-result-action/blob/v1.20/README.md#the-symbols "failed tests") ±0 

Results for commit 35704ec5. ± Comparison against base commit 5ac52166.

[test-results]:data:application/gzip;base64,H4sIAMicJWQC/03MSw7CIBSF4a00jB3wuoBuxrS3kBDbYiiMjHv3Wlvs8P9Ocl4sxMmv7NbpS8fWGkuLsea+xLRQApcENJVt5Oqo+1oRidQV/vSITyLXIPRxIuANfM4p75Lr8v20Vu9xXFopmvweQR1wetz6fIhpnmOhYAos1x6BcwQRwiBlPwgxOAPOCDAm4Gis0MjeHzP0Om0GAQAA


Patch:
diff --git a/fitbenchmarking/core/results_output.py b/fitbenchmarking/core/results_output.py
index b67d7931..0d729612 100644
--- a/fitbenchmarking/core/results_output.py
+++ b/fitbenchmarking/core/results_output.py
@@ -456,13 +456,21 @@ def open_browser(output_file: str, options) -> None:
     :param output_file: The absolute path to the results index file.
     :type output_file: str
     """
-    # Uses the relative path so that the browser can open on Mac and WSL
-    relative_path = os.path.relpath(output_file)
-    # Constructs a url that can be pasted into a browser
-    is_mac = platform.system() == "Darwin"
-    url = "file://" + output_file if is_mac else output_file
+    use_url = False
+    # On Mac, need prefix for webbrowser
+    if platform.system() == 'Darwin':
+        url = "file://" + output_file
+        use_url = True
+    else:
+        url = output_file
+    # On windows can have drive clashes so need to use absolute path
+    if platform.system() == 'Windows':
+        use_url = True
+
     if options.results_browser:
-        if webbrowser.open_new(url if is_mac else relative_path):
+        # Uses the relative path so that the browser can open on WSL
+        to_open = url if use_url else os.path.relpath(output_file)
+        if webbrowser.open_new(to_open):
             LOGGER.info("\nINFO:\nThe FitBenchmarking results have been opened"
                         " in your browser from this url:\n\n   %s", url)
         else:
@@ -471,4 +479,5 @@ def open_browser(output_file: str, options) -> None:
                            "into your browser:\n\n   %s", url)
     else:
         LOGGER.info("\nINFO:\nYou have chosen not to open FitBenchmarking "
-                    "results in your browser\n\n   %s",)
+                    "results in your browser. You can use this link to see the"
+                    "results: \n\n   %s", url)
diff --git a/fitbenchmarking/results_processing/fitting_report.py b/fitbenchmarking/results_processing/fitting_report.py
index 4672ca12..e82ac858 100644
--- a/fitbenchmarking/results_processing/fitting_report.py
+++ b/fitbenchmarking/results_processing/fitting_report.py
@@ -95,7 +95,7 @@ def create_prob_group(result, support_pages_dir, options):
             fitted_plot_available=fit_success,
             fitted_plot=fig_fit))
 
-    result.fitting_report_link = os.path.relpath(file_path)
+    result.fitting_report_link = os.path.abspath(file_path)
 
 
 def get_figure_paths(result):


Test patch:
diff --git a/fitbenchmarking/results_processing/tests/test_fitting_report.py b/fitbenchmarking/results_processing/tests/test_fitting_report.py
index b8f90c99..ba696395 100644
--- a/fitbenchmarking/results_processing/tests/test_fitting_report.py
+++ b/fitbenchmarking/results_processing/tests/test_fitting_report.py
@@ -93,8 +93,8 @@ class CreateProbGroupTests(unittest.TestCase):
                                          support_pages_dir=self.dir.name,
                                          options=self.options)
         file_name = self.result.fitting_report_link
-        expected = os.path.join(os.path.relpath(self.dir.name),
-                                'prob_0_cf1_m10_[s1]_jj0.html')
+        expected = os.path.abspath(
+            os.path.join(self.dir.name, 'prob_0_cf1_m10_[s1]_jj0.html'))
 
         self.assertEqual(file_name, expected)