diff --git a/features/src/browsers/README.md b/features/src/browsers/README.md index 1d5aca3..4fea279 100755 --- a/features/src/browsers/README.md +++ b/features/src/browsers/README.md @@ -6,7 +6,7 @@ Installs various browsers and their dependencies. ```json "features": { - "ghcr.io/postfinance/devcontainer-features/browsers:1.1.0": { + "ghcr.io/postfinance/devcontainer-features/browsers:1.2.0": { "chromeVersion": "none", "useChromeForTesting": true, "chromeDownloadUrl": "", diff --git a/features/src/browsers/devcontainer-feature.json b/features/src/browsers/devcontainer-feature.json index 46243bb..fe9a00a 100644 --- a/features/src/browsers/devcontainer-feature.json +++ b/features/src/browsers/devcontainer-feature.json @@ -1,6 +1,6 @@ { "id": "browsers", - "version": "1.1.0", + "version": "1.2.0", "name": "Browsers", "description": "Installs various browsers and their dependencies.", "options": { @@ -60,4 +60,4 @@ "description": "If true, resolves partial Firefox versions (e.g. 142.0) to the highest available patch version (e.g. 142.0.3)." } } -} \ No newline at end of file +} diff --git a/features/src/browsers/installer.go b/features/src/browsers/installer.go index 208fd21..00db3d0 100644 --- a/features/src/browsers/installer.go +++ b/features/src/browsers/installer.go @@ -123,18 +123,16 @@ func (c *chromeComponent) GetAllVersions() ([]*gover.Version, error) { func (c *chromeComponent) InstallVersion(version *gover.Version) error { archPart, err := installer.Tools.System.MapArchitecture(map[string]string{ - installer.AMD64: "x86_64", - installer.ARM64: "aarch64", + installer.AMD64: "amd64", + installer.ARM64: "arm64", }) if err != nil { return err } - if archPart == "aarch64" { - return fmt.Errorf("chrome is not available for ARM64") - } + // Download the file - fileName := "google-chrome-stable_amd64.deb" - downloadUrl := fmt.Sprintf("%s/google-chrome-stable_%s-1_amd64.deb", c.ChromeDownloadBaseUrl, version.Raw) + fileName := fmt.Sprintf("google-chrome-stable_%s.deb", archPart) + downloadUrl := fmt.Sprintf("%s/google-chrome-stable_%s-1_%s.deb", c.ChromeDownloadBaseUrl, version.Raw, archPart) if err := installer.Tools.Download.ToFile(downloadUrl, fileName, "Chrome"); err != nil { return err } @@ -189,16 +187,13 @@ func (c *chromeForTestingComponent) GetAllVersions() ([]*gover.Version, error) { } func (c *chromeForTestingComponent) InstallVersion(version *gover.Version) error { - archPart, err := installer.Tools.System.MapArchitecture(map[string]string{ - installer.AMD64: "x86_64", - installer.ARM64: "aarch64", + _, err := installer.Tools.System.MapArchitecture(map[string]string{ + installer.AMD64: "amd64", + installer.ARM64: "arm64", }) if err != nil { return err } - if archPart == "aarch64" { - return fmt.Errorf("chrome for testing is not available for ARM64") - } // Remove /known-good-versions.json from end if present using split downloadBaseUrl := c.TestingVersionsUrl if len(downloadBaseUrl) > 0 { @@ -345,6 +340,9 @@ func (c *firefoxComponent) InstallVersion(version *gover.Version) error { fileName = "firefox.tar.bz2" downloadUrl = fmt.Sprintf("%s/%s/linux-%s/en-US/firefox-%s.tar.bz2", c.FirefoxDownloadBaseUrl, version.Raw, archPart, version.Raw) } + if version.LessThan(gover.ParseSimple("136")) && archPart == "aarch64" { + return fmt.Errorf("firefox versions less than 136 are not available for ARM64") + } // Download the file if err := installer.Tools.Download.ToFile(downloadUrl, fileName, "Firefox"); err != nil { return err diff --git a/features/test/browsers/chrome-testing.sh b/features/test/browsers/chrome-testing.sh index 88c2ee6..0c1cb99 100644 --- a/features/test/browsers/chrome-testing.sh +++ b/features/test/browsers/chrome-testing.sh @@ -4,7 +4,7 @@ set -e [[ -f "$(dirname "$0")/../functions.sh" ]] && source "$(dirname "$0")/../functions.sh" [[ -f "$(dirname "$0")/functions.sh" ]] && source "$(dirname "$0")/functions.sh" -check_version "$(chrome --version)" "Google Chrome for Testing 142.0.7444.162" +check_version "$(chrome --version)" "Google Chrome for Testing 155.0.8059.39" check_command_not_exists "google-chrome" check_command_not_exists "firefox" diff --git a/features/test/browsers/chrome.sh b/features/test/browsers/chrome.sh index c1cb313..ed8abff 100644 --- a/features/test/browsers/chrome.sh +++ b/features/test/browsers/chrome.sh @@ -4,7 +4,7 @@ set -e [[ -f "$(dirname "$0")/../functions.sh" ]] && source "$(dirname "$0")/../functions.sh" [[ -f "$(dirname "$0")/functions.sh" ]] && source "$(dirname "$0")/functions.sh" -check_version "$(google-chrome --version)" "Google Chrome 142.0.7444.162" +check_version "$(google-chrome --version)" "Google Chrome 155.0.8059.39" check_command_not_exists "chrome" check_command_not_exists "firefox" diff --git a/features/test/browsers/firefox-after-135.sh b/features/test/browsers/firefox-after-135.sh index d6b8c79..2a0e7ef 100644 --- a/features/test/browsers/firefox-after-135.sh +++ b/features/test/browsers/firefox-after-135.sh @@ -4,7 +4,7 @@ set -e [[ -f "$(dirname "$0")/../functions.sh" ]] && source "$(dirname "$0")/../functions.sh" [[ -f "$(dirname "$0")/functions.sh" ]] && source "$(dirname "$0")/functions.sh" -check_version "$(firefox --version)" "Mozilla Firefox 135.0" +check_version "$(firefox --version)" "Mozilla Firefox 136.0" check_command_not_exists "google-chrome" check_command_not_exists "chrome" diff --git a/features/test/browsers/scenarios.json b/features/test/browsers/scenarios.json index 7ddf529..0a7e5e6 100644 --- a/features/test/browsers/scenarios.json +++ b/features/test/browsers/scenarios.json @@ -5,7 +5,7 @@ }, "features": { "./browsers": { - "chromeVersion": "142.0.7444.162", + "chromeVersion": "155.0.8059.39", "useChromeForTesting": "false", "firefoxVersion": "none" } @@ -17,7 +17,7 @@ }, "features": { "./browsers": { - "chromeVersion": "142.0.7444.162", + "chromeVersion": "155.0.8059.39", "useChromeForTesting": "true", "firefoxVersion": "none" } @@ -43,7 +43,7 @@ "./browsers": { "chromeVersion": "none", "useChromeForTesting": "false", - "firefoxVersion": "135.0" + "firefoxVersion": "136.0" } } }