Skip to content

Commit

Permalink
feat: setup OS proxy (#207)
Browse files Browse the repository at this point in the history
* feat: setup OS proxy

* Update src/network-proxy.ts

Co-authored-by: Alex Plischke <alex.plischke@saucelabs.com>

* Update src/testcafe-runner.ts

Co-authored-by: Alex Plischke <alex.plischke@saucelabs.com>

* Update src/testcafe-runner.ts

Co-authored-by: Alex Plischke <alex.plischke@saucelabs.com>

* Update src/network-proxy.ts

Co-authored-by: Alex Plischke <alex.plischke@saucelabs.com>

* add comments to explain why we need the os proxy

* add type for proxy

* add e2e test for proxy

* add comments for isCDPDisabled

* update e2e tests for sauce-connect and proxy

* revert npm ci changes

* add comment and do checks more precisely

* revert settings

* cleanup pipeline

* save pipeline

* update comments and revert sc tests

* only run sc for proxy check

* Update src/testcafe-runner.ts

Co-authored-by: Alex Plischke <alex.plischke@saucelabs.com>

* revised

---------

Co-authored-by: Alex Plischke <alex.plischke@saucelabs.com>
  • Loading branch information
tianfeng92 and alexplischke committed Oct 23, 2023
1 parent aaf4bab commit 920a542
Show file tree
Hide file tree
Showing 10 changed files with 373 additions and 126 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
echo "tag_name=${TAG_NAME}" >> $GITHUB_OUTPUT
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
if: ${{ steps.prep.outputs.tag_name == '' }}
with:
ref: ${{ github.ref }}
Expand Down Expand Up @@ -121,7 +121,7 @@ jobs:
- run: Write-Output "${{ steps.prep.outputs.release_id }} - ${{ steps.prep.outputs.version }} - ${{ steps.prep.outputs.asset_id }}"

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
if: ${{ steps.prep.outputs.asset_id == '' }}
with:
ref: ${{ steps.prep.outputs.version }}
Expand Down Expand Up @@ -195,7 +195,7 @@ jobs:
- run: echo "${{ steps.prep.outputs.release_id }} - ${{ steps.prep.outputs.version }} - ${{ steps.prep.outputs.asset_id }}"

- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
if: ${{ steps.prep.outputs.asset_id == '' }}
with:
ref: ${{ steps.prep.outputs.version }}
Expand Down Expand Up @@ -275,10 +275,10 @@ jobs:
SAUCE_USERNAME: ${{secrets.SAUCE_USERNAME}}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup saucectl
uses: saucelabs/saucectl-run-action@v3
uses: saucelabs/saucectl-run-action@v4
env:
GITHUB_TOKEN: ${{ github.token }}
with:
Expand Down Expand Up @@ -308,10 +308,10 @@ jobs:
SAUCE_USERNAME: ${{secrets.SAUCE_USERNAME}}
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup saucectl
uses: saucelabs/saucectl-run-action@v3
uses: saucelabs/saucectl-run-action@v4
env:
GITHUB_TOKEN: ${{ github.token }}
with:
Expand Down
67 changes: 59 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v3
Expand Down Expand Up @@ -50,7 +50,7 @@ jobs:
needs: [test]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v3
Expand Down Expand Up @@ -108,7 +108,7 @@ jobs:
needs: [test]
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v3
Expand Down Expand Up @@ -179,10 +179,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup saucectl
uses: saucelabs/saucectl-run-action@v3
uses: saucelabs/saucectl-run-action@v4
env:
GITHUB_TOKEN: ${{ github.token }}
with:
Expand Down Expand Up @@ -223,15 +223,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Setup saucectl
uses: saucelabs/saucectl-run-action@v3
uses: saucelabs/saucectl-run-action@v4
env:
GITHUB_TOKEN: ${{ github.token }}
with:
Expand All @@ -248,7 +248,7 @@ jobs:
username: ${{ secrets.SAUCE_USERNAME }}
accessKey: ${{ secrets.SAUCE_ACCESS_KEY }}
tunnelName: github-testcafe-sc-check-tunnel-${{ matrix.os }}-${{ matrix.browser }}
scVersion: 4.8.1
scVersion: 4.9.1

- name: Test on Sauce
working-directory: ./tests/cloud/
Expand All @@ -263,3 +263,54 @@ jobs:
--config ./.sauce/config-sc.yml \
--tunnel-name github-testcafe-sc-check-tunnel-${{ matrix.os }}-${{ matrix.browser }} \
--select-suite "${{ matrix.os }} - ${{ matrix.browser }}"
bundle-test-proxy:
needs: [build-windows-bundle, build-mac-bundle]
strategy:
max-parallel: 3
fail-fast: false
matrix:
os: [Win11, macOS13]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Setup saucectl
uses: saucelabs/saucectl-run-action@v4
env:
GITHUB_TOKEN: ${{ github.token }}
with:
skip-run: true

- name: Run web-page
run: |
python -m http.server 8000 &
working-directory: ./tests/cloud/www/

- name: Start sauce-connect
uses: saucelabs/sauce-connect-action@v2
with:
username: ${{ secrets.SAUCE_USERNAME }}
accessKey: ${{ secrets.SAUCE_ACCESS_KEY }}
tunnelName: github-testcafe-sc-check-tunnel-${{ matrix.os }}
scVersion: 4.9.1

- name: Test on Sauce
working-directory: ./tests/cloud/
run: |
BUNDLE_URL=https://storage.googleapis.com/${{ secrets.GCS_RUNNER_BUCKET }}/testcafe-windows-amd64-${{ github.run_id }}.zip
if [[ ${{ matrix.os }} =~ ^mac ]];then
BUNDLE_URL=https://storage.googleapis.com/${{ secrets.GCS_RUNNER_BUCKET }}/testcafe-macos-amd64-${{ github.run_id }}.zip
fi
saucectl run \
--runner-version "url: ${BUNDLE_URL}" \
--config ./.sauce/config-proxy.yml \
--tunnel-name github-testcafe-sc-check-tunnel-${{ matrix.os }} \
--select-suite "Proxy - ${{ matrix.os }}"
Loading

0 comments on commit 920a542

Please sign in to comment.