Skip to content

Commit

Permalink
Merge branch 'trunk' into opentelemetry_upgrade_0.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
pujagani committed Nov 23, 2020
2 parents 6a8e332 + 4975741 commit ebc604a
Show file tree
Hide file tree
Showing 52 changed files with 740 additions and 136 deletions.
3 changes: 3 additions & 0 deletions .bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,13 @@ build --test_output=errors
build --noexperimental_sandbox_default_allow_network

# pass environment variables to the test environment
build --test_env=CI
build --test_env=GITHUB_ACTIONS
build --test_env=TRAVIS
build --test_env=DISPLAY
build --test_env=MOZ_HEADLESS
build --test_env=DASHBOARD_URL
build --test_env=LOCALAPPDATA
build --test_env=SELENIUM_BROWSER

test --test_timeout=180
12 changes: 12 additions & 0 deletions .github/.bazelrc.local
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Set up caching on local disk so incremental builds are faster
# See https://bazel.build/designs/2016/09/30/repository-cache.html
build --repository_cache=~/.cache/bazel-repo
test --repository_cache=~/.cache/bazel-repo
# See https://docs.bazel.build/versions/master/remote-caching.html#disk-cache
build --disk_cache=~/.cache/bazel-disk
test --disk_cache=~/.cache/bazel-disk"

# Make output easier to read
build --curses=no
build --color=no
build --show_timestamps
11 changes: 11 additions & 0 deletions .github/actions/bazel-test/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: 'Run bazel query and pass found targets to bazel test'
inputs:
query: # id of input
required: true
runs:
using: "composite"
steps:
- run: |
cp .github/.bazelrc.local .
bazel query "${{ inputs.query }}" | xargs bazel test
shell: bash
11 changes: 11 additions & 0 deletions .github/actions/bazel/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: 'Run bazel'
inputs:
command: # id of input
required: true
runs:
using: "composite"
steps:
- run: |
cp .github/.bazelrc.local .
bazel ${{ inputs.command }}
shell: bash
12 changes: 12 additions & 0 deletions .github/actions/setup-bazelisk/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: 'Setup bazelisk'
inputs:
version: # id of input
required: false
default: 'v1.7.4'
runs:
using: "composite"
steps:
- run: |
curl -L -o bazelisk "https://github.com/bazelbuild/bazelisk/releases/download/v1.7.4/bazelisk-linux-amd64"
chmod +x bazelisk && sudo mv bazelisk /usr/local/bin/bazel
shell: bash
21 changes: 21 additions & 0 deletions .github/actions/setup-chrome/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: 'Setup Chrome and chromedriver'
runs:
using: "composite"
steps:
- run: |
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
echo "deb http://dl.google.com/linux/chrome/deb/ stable main" | sudo tee -a /etc/apt/sources.list.d/google-chrome.list
sudo apt-get update -qqy
sudo apt-get -qqy install google-chrome-stable
CHROME_VERSION=$(google-chrome-stable --version)
CHROME_FULL_VERSION=${CHROME_VERSION%%.*}
CHROME_MAJOR_VERSION=${CHROME_FULL_VERSION//[!0-9]}
sudo rm /etc/apt/sources.list.d/google-chrome.list
export CHROMEDRIVER_VERSION=`curl -s https://chromedriver.storage.googleapis.com/LATEST_RELEASE_${CHROME_MAJOR_VERSION%%.*}`
curl -L -O "https://chromedriver.storage.googleapis.com/${CHROMEDRIVER_VERSION}/chromedriver_linux64.zip"
unzip chromedriver_linux64.zip && chmod +x chromedriver && sudo mv chromedriver /usr/local/bin
export CHROMEDRIVER_VERSION=`curl -s https://chromedriver.storage.googleapis.com/LATEST_RELEASE_${CHROME_MAJOR_VERSION%%.*}`
curl -L -O "https://chromedriver.storage.googleapis.com/${CHROMEDRIVER_VERSION}/chromedriver_linux64.zip"
unzip chromedriver_linux64.zip && chmod +x chromedriver && sudo mv chromedriver /usr/local/bin
chromedriver -version
shell: bash
13 changes: 13 additions & 0 deletions .github/actions/setup-firefox/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: 'Setup Firefox and geckodriver'
runs:
using: "composite"
steps:
- run: |
GECKODRIVER_URL=`curl -Ls -o /dev/null -w %{url_effective} https://github.com/mozilla/geckodriver/releases/latest`
GECKODRIVER_VERSION=`echo $GECKODRIVER_URL | sed 's#.*/##'`
export GECKODRIVER_DOWNLOAD="https://github.com/mozilla/geckodriver/releases/download/$GECKODRIVER_VERSION/geckodriver-$GECKODRIVER_VERSION-linux64.tar.gz"
curl -L -o geckodriver.tar.gz $GECKODRIVER_DOWNLOAD
gunzip -c geckodriver.tar.gz | tar xopf -
chmod +x geckodriver && sudo mv geckodriver /usr/local/bin
geckodriver --version
shell: bash
184 changes: 184 additions & 0 deletions .github/workflows/java.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,184 @@
name: Java workflow

on:
push:
branches:
- trunk
pull_request:
branches:
- trunk

env:
NODE_VERSION: '13.x'

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout source tree
uses: actions/checkout@v2
- name: Cache Bazel artifacts
uses: actions/cache@v2
with:
path: |
~/.cache/bazel-disk
~/.cache/bazel-repo
key: ${{ runner.os }}-bazel-build-${{ hashFiles('**/BUILD.bazel') }}
restore-keys: |
${{ runner.os }}-bazel-build-
- name: Setup bazelisk
uses: ./.github/actions/setup-bazelisk
- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: '11'
- name: Build grid
uses: ./.github/actions/bazel
with:
command: build grid

small_tests:
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout source tree
uses: actions/checkout@v1
- name: Cache Bazel artifacts
uses: actions/cache@v2
with:
path: |
~/.cache/bazel-disk
~/.cache/bazel-repo
key: ${{ runner.os }}-bazel-small-tests-${{ hashFiles('**/BUILD.bazel') }}
restore-keys: |
${{ runner.os }}-bazel-small-tests-
${{ runner.os }}-bazel-build-
- name: Setup bazelisk
uses: ./.github/actions/setup-bazelisk
- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: '11'
- name: Run small tests
uses: ./.github/actions/bazel-test
with:
query: attr(size, small, tests(//java/...)) except attr(tags, lint, tests(//java/...))

lint:
needs: small_tests
runs-on: ubuntu-latest
steps:
- name: Checkout source tree
uses: actions/checkout@v1
- name: Cache Bazel artifacts
uses: actions/cache@v2
with:
path: |
~/.cache/bazel-disk
~/.cache/bazel-repo
key: ${{ runner.os }}-bazel-lint-${{ hashFiles('**/BUILD.bazel') }}
restore-keys: |
${{ runner.os }}-bazel-lint-
${{ runner.os }}-bazel-build-
- name: Setup bazelisk
uses: ./.github/actions/setup-bazelisk
- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: '11'
- name: Run linter
uses: ./.github/actions/bazel-test
with:
query: attr(tags, lint, tests(//java/...))

chrome_tests:
needs: small_tests
runs-on: ubuntu-latest
steps:
- name: Checkout source tree
uses: actions/checkout@v1
- name: Cache Bazel artifacts
uses: actions/cache@v2
with:
path: |
~/.cache/bazel-disk
~/.cache/bazel-repo
key: ${{ runner.os }}-bazel-chrome-tests-${{ hashFiles('**/BUILD.bazel') }}
restore-keys: |
${{ runner.os }}-bazel-chrome-tests-
${{ runner.os }}-bazel-build-
- name: Setup bazelisk
uses: ./.github/actions/setup-bazelisk
- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: '11'
- name: Setup Chrome and chromedriver
uses: ./.github/actions/setup-chrome
- name: Run browser tests in Chrome
uses: ./.github/actions/bazel-test
with:
query: attr(tags, chrome, tests(//java/client/...)) except attr(tags, remote, tests(//java/client/...))

firefox_tests:
needs: small_tests
runs-on: ubuntu-latest
steps:
- name: Checkout source tree
uses: actions/checkout@v1
- name: Cache Bazel artifacts
uses: actions/cache@v2
with:
path: |
~/.cache/bazel-disk
~/.cache/bazel-repo
key: ${{ runner.os }}-bazel-firefox-tests-${{ hashFiles('**/BUILD.bazel') }}
restore-keys: |
${{ runner.os }}-bazel-firefox-tests-
${{ runner.os }}-bazel-build-
- name: Setup bazelisk
uses: ./.github/actions/setup-bazelisk
- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: '11'
- name: Setup Firefox and geckodriver
uses: ./.github/actions/setup-firefox
- name: Run browser tests in Firefox
uses: ./.github/actions/bazel-test
with:
query: attr(tags, firefox, tests(//java/client/...)) except attr(tags, remote, tests(//java/client/...))


server_tests:
needs: small_tests
runs-on: ubuntu-latest
steps:
- name: Checkout source tree
uses: actions/checkout@v1
- name: Cache Bazel artifacts
uses: actions/cache@v2
with:
path: |
~/.cache/bazel-disk
~/.cache/bazel-repo
key: ${{ runner.os }}-bazel-firefox-tests-${{ hashFiles('**/BUILD.bazel') }}
restore-keys: |
${{ runner.os }}-bazel-firefox-tests-
${{ runner.os }}-bazel-build-
- name: Setup bazelisk
uses: ./.github/actions/setup-bazelisk
- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: '11'
- name: Setup Chrome and chromedriver
uses: ./.github/actions/setup-chrome
- name: Setup Firefox and geckodriver
uses: ./.github/actions/setup-firefox
- name: Run server tests
env:
MOZ_HEADLESS: 1
uses: ./.github/actions/bazel-test
with:
query: tests(//java/server/...) except attr(tags, 'lint|ie|edge|edgehtml|safari', tests(//java/server/...))
33 changes: 33 additions & 0 deletions .github/workflows/javascript.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: JavaScript workflow

on:
push:
branches:
- trunk
pull_request:
branches:
- trunk

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout source tree
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 15
- name: Setup Java
uses: actions/setup-java@v1
with:
java-version: 11
- name: Setup bazelisk
uses: ./.github/actions/setup-bazelisk
- name: Start XVFB
run: Xvfb :99 &
- name: Run JavaScript tests on Firefox
run: bazel test //javascript/node/selenium-webdriver:tests
env:
DISPLAY: :99
SELENIUM_BROWSER: firefox
15 changes: 0 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,27 +61,12 @@ matrix:
- env: MARIONETTE=1 SELENIUM_BROWSER=firefox NPM=test
<<: *node
<<: *firefox-latest
- env: BZL="build //java/..." SONAR=1
<<: *java
- env: BZL_TEST="attr(size, small, tests(//java/...)) except attr(tags, lint, tests(//java/...))"
<<: *java
- env: BZL_TEST="attr(tags, lint, tests(//java/...))"
<<: *java
- env: MARIONETTE=1 BZL_TEST="attr(tags, firefox, tests(//java/client/...)) except attr(tags, remote, tests(//java/client/...))"
<<: *java
<<: *firefox-nightly
- env: CHROME=1 BZL_TEST="attr(tags, chrome, tests(//java/client/...)) except attr(tags, remote, tests(//java/client/...))"
<<: *java
<<: *chrome
- env: MARIONETTE=1 MOZ_HEADLESS=1 BZL="test --test_tag_filters=firefox //javascript/atoms/... //javascript/selenium-atoms/... //javascript/webdriver/..."
<<: *java
<<: *firefox-latest
- env: CHROME=1 BZL="test --test_tag_filters=chrome //javascript/atoms/... //javascript/selenium-atoms/... //javascript/webdriver/... //javascript/chrome-driver/..."
<<: *java
<<: *chrome
- env: CHROME=1 MARIONETTE=1 BZL_TEST="tests(//java/server/...) except attr(tags, 'lint|ie|edge|edgehtml|safari', tests(//java/server/...))"
<<: *java
<<: *firefox-nightly
- env: TASK=javadocs
<<: *java
- env: TOXENV=flake8
Expand Down
3 changes: 2 additions & 1 deletion java/client/src/org/openqa/selenium/Cookie.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;
import java.util.Objects;
import java.util.TreeMap;

public class Cookie implements Serializable {
Expand Down Expand Up @@ -269,7 +270,7 @@ public boolean equals(Object o) {
if (!name.equals(cookie.name)) {
return false;
}
return !(value != null ? !value.equals(cookie.value) : cookie.value != null);
return Objects.equals(value, cookie.value);
}

@Override
Expand Down
Loading

0 comments on commit ebc604a

Please sign in to comment.