Skip to content

Commit

Permalink
Revert changes
Browse files Browse the repository at this point in the history
Signed-off-by: Viet Nguyen Duc <[email protected]>
  • Loading branch information
VietND96 committed Jan 21, 2025
1 parent fc257c2 commit 70ef6c4
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 22 deletions.
17 changes: 10 additions & 7 deletions .github/actions/get-latest-upstream/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,25 @@ runs:
steps:
- name: Get latest upstream
shell: bash
env:
IS_RELEASE: ${{ github.event.inputs.release || 'true' }}
GH_CLI_TOKEN: ${{ inputs.gh_cli_token }}
run: |
sudo apt update
sudo apt install jq
AUTH_HEADER="Authorization: token ${{ inputs.gh_cli_token }}"
if [ "${{ inputs.release }}" = "true" ]; then
sudo apt install gh
echo "${GH_CLI_TOKEN}" | gh auth login --with-token
if [ "${IS_RELEASE}" = "true" ]; then
echo "Getting the latest stable release."
RELEASE=$(curl -s -H "$AUTH_HEADER" https://api.github.com/repos/SeleniumHQ/selenium/releases | jq -r '[.[] | select(.prerelease == false)] | .[0].tag_name')
RELEASE=$(gh release list -R SeleniumHQ/selenium | grep -v nightly | awk '{ print $4 }' | head -1)
else
echo "Getting the latest Nightly release."
RELEASE=$(curl -s -H "$AUTH_HEADER" https://api.github.com/repos/SeleniumHQ/selenium/releases | jq -r '[.[] | select(.prerelease == true)] | .[0].tag_name')
RELEASE=$(gh release list -R SeleniumHQ/selenium | grep nightly | awk '{ print $3 }' | head -1)
if [ -z "${RELEASE}" ]; then
echo "Nightly release not found, getting the latest stable release."
RELEASE=$(curl -s -H "$AUTH_HEADER" https://api.github.com/repos/SeleniumHQ/selenium/releases | jq -r '[.[] | select(.prerelease == false)] | .[0].tag_name')
RELEASE=$(gh release list -R SeleniumHQ/selenium | grep -v nightly | awk '{ print $4 }' | head -1)
fi
fi
jar_file=$(curl -s -H "$AUTH_HEADER" https://api.github.com/repos/SeleniumHQ/selenium/releases/tags/${RELEASE} | jq -r '.assets[] | select(.name | endswith(".jar")) | .name' | tail -n 1)
jar_file=$(gh release view -R SeleniumHQ/selenium ${RELEASE} | grep jar | awk '{ print $2 }' | tail -n 1)
echo "Server package: ${jar_file}"
VERSION=$(echo $jar_file | sed 's/selenium-server-//;s/\.jar//')
echo "BASE_RELEASE=${RELEASE} | BASE_VERSION=${VERSION} | VERSION=${VERSION}"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
description: 'Test a new release process'
required: false
type: string
default: 'false'
default: 'true'
workflow_dispatch:
inputs:
rerunFailedOnly:
Expand Down Expand Up @@ -49,15 +49,15 @@ jobs:
name: Test Selenium Grid on Docker
uses: ./.github/workflows/docker-test.yml
with:
release: ${{ inputs.release == 'true' }}
release: ${{ github.event.inputs.release || 'true' }}

helm-chart-test:
if: contains(toJson(github.event.commits), '[skip test]') == false
name: Test Selenium Grid on Kubernetes
uses: ./.github/workflows/helm-chart-test.yml
secrets: inherit
with:
release: ${{ inputs.release == 'true' }}
release: ${{ github.event.inputs.release || 'true' }}

rerun-workflow-when-failure:
name: Rerun workflow when failure
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docker-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
description: 'Test a new release process'
required: false
type: string
default: 'false'
default: 'true'
workflow_dispatch:
inputs:
request-timeout:
Expand Down Expand Up @@ -207,7 +207,7 @@ jobs:
- name: Set Selenium base version
uses: ./.github/actions/get-latest-upstream
with:
release: ${{ inputs.release || false }}
release: ${{ github.event.inputs.release || 'true' }}
gh_cli_token: ${{ secrets.GITHUB_TOKEN }}
- name: Sets build date
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/helm-chart-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
uses: ./.github/workflows/helm-chart-test.yml
secrets: inherit
with:
release: ${{ github.event.inputs.release == 'true' }}
release: ${{ github.event.inputs.release || 'true' }}

release:
needs:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/helm-chart-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
description: 'Test a new release process'
required: false
type: string
default: 'false'
default: 'true'
workflow_dispatch:
inputs:
request-timeout:
Expand Down Expand Up @@ -44,7 +44,7 @@ jobs:
cluster: 'minikube'
helm-version: 'v3.11.3'
docker-version: '26.1.4'
python-version: '3.8'
python-version: '3.9'
test-upgrade: true
service-mesh: false
os: ubuntu-24.04
Expand Down Expand Up @@ -149,7 +149,7 @@ jobs:
- name: Set Selenium base version
uses: ./.github/actions/get-latest-upstream
with:
release: ${{ inputs.release || false }}
release: ${{ github.event.inputs.release || 'true' }}
gh_cli_token: ${{ secrets.GITHUB_TOKEN }}
- name: Sets build date
run: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/k8s-scaling-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
description: 'Test a new release process'
required: false
type: string
default: 'false'
default: 'true'
push-results:
description: 'Publish the results to the repository'
required: false
Expand Down Expand Up @@ -139,7 +139,7 @@ jobs:
- name: Set Selenium base version
uses: ./.github/actions/get-latest-upstream
with:
release: ${{ inputs.release || false }}
release: ${{ github.event.inputs.release || 'true' }}
gh_cli_token: ${{ secrets.GITHUB_TOKEN }}
- name: Sets build date
run: |
Expand Down
6 changes: 3 additions & 3 deletions Video/video.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ ts_format=${SE_LOG_TIMESTAMP_FORMAT:-"%Y-%m-%d %H:%M:%S,%3N"}
process_name="video.recorder"

if [ "${SE_VIDEO_RECORD_STANDALONE}" = "true" ]; then
JQ_SESSION_ID_QUERY=".value.nodes[-1]?.slots[-1]?.session?.sessionId"
JQ_SESSION_ID_QUERY=".value.nodes[]?.slots[]?.session?.sessionId"
SE_NODE_PORT=${SE_NODE_PORT:-"4444"}
NODE_STATUS_ENDPOINT="$(/opt/bin/video_gridUrl.sh)/status"
else
JQ_SESSION_ID_QUERY=".[-1]?.node?.slots | .[-1]?.session?.sessionId"
JQ_SESSION_ID_QUERY=".[]?.node?.slots | .[0]?.session?.sessionId"
SE_NODE_PORT=${SE_NODE_PORT:-"5555"}
NODE_STATUS_ENDPOINT="${SE_SERVER_PROTOCOL}://${DISPLAY_CONTAINER_NAME}:${SE_NODE_PORT}/status"
fi
Expand Down Expand Up @@ -259,7 +259,7 @@ else
fi
echo "$(date -u +"${ts_format}") [${process_name}] - Video recording started"
sleep ${poll_interval}
elif [[ "$recording_started" = "true" && ("$session_id" != "$prev_session_id" || "$session_id" == "null" || "$session_id" == "") ]]; then
elif [[ "$session_id" != "$prev_session_id" && "$recording_started" = "true" ]]; then
stop_recording
wait_for_file_integrity
if [[ $max_recorded_count -gt 0 ]] && [[ $recorded_count -ge $max_recorded_count ]]; then
Expand Down
2 changes: 1 addition & 1 deletion Video/video_graphQLQuery.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env bash

max_time=1
retry_time=2
retry_time=3

# Define parameters
SESSION_ID=$1
Expand Down

0 comments on commit 70ef6c4

Please sign in to comment.