Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion features/src/browsers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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": "",
Expand Down
4 changes: 2 additions & 2 deletions features/src/browsers/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "browsers",
"version": "1.1.0",
"version": "1.2.0",
"name": "Browsers",
"description": "Installs various browsers and their dependencies.",
"options": {
Expand Down Expand Up @@ -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)."
}
}
}
}
24 changes: 11 additions & 13 deletions features/src/browsers/installer.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion features/test/browsers/chrome-testing.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion features/test/browsers/chrome.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion features/test/browsers/firefox-after-135.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
6 changes: 3 additions & 3 deletions features/test/browsers/scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
},
"features": {
"./browsers": {
"chromeVersion": "142.0.7444.162",
"chromeVersion": "155.0.8059.39",
"useChromeForTesting": "false",
"firefoxVersion": "none"
}
Expand All @@ -17,7 +17,7 @@
},
"features": {
"./browsers": {
"chromeVersion": "142.0.7444.162",
"chromeVersion": "155.0.8059.39",
"useChromeForTesting": "true",
"firefoxVersion": "none"
}
Expand All @@ -43,7 +43,7 @@
"./browsers": {
"chromeVersion": "none",
"useChromeForTesting": "false",
"firefoxVersion": "135.0"
"firefoxVersion": "136.0"
}
}
}
Expand Down
Loading