Skip to content

Commit

Permalink
Change image
Browse files Browse the repository at this point in the history
Signed-off-by: Anton Engelhardt <[email protected]>
  • Loading branch information
antonengelhardt committed Nov 16, 2023
1 parent f585244 commit 2c94f98
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 36 deletions.
45 changes: 12 additions & 33 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
run: |
cargo build --target wasm32-wasi --release
- name: Make plugin available to next job
- name: Upload plugin as artifact
uses: actions/upload-artifact@v2
with:
name: plugin
Expand All @@ -56,26 +56,10 @@ jobs:
integration-test:
runs-on: ubuntu-latest
container:
image: antonengelhardt/rust-docker-tools
image: selenium/standalone-chrome:latest
needs: [build]

# services:
# envoy:
# image: docker.io/envoyproxy/envoy:v1.24-latest
# ports:
# - "10000:10000"
# volumes:
# - ./envoy.yaml:/etc/envoy/envoy.yaml
# - ../target/wasm32-wasi/release:/etc/envoy/proxy-wasm-plugins
# options: envoy -c /etc/envoy/envoy.yaml --concurrency 1

# httpbin:
# image: docker.io/kennethreitz/httpbin
# ports:
# - "80:80"

steps:

- name: Checkout code
uses: actions/checkout@v3

Expand All @@ -94,29 +78,24 @@ jobs:
- name: Install Chrome, Chromedriver, Docker and Python (and pip)
run: |
apk update
apk add chromium
apk add chromium-chromedriver
apk add docker
apk add python3
apk add py3-pip
apk add tree
apt update
apt install chromium
apt install docker
apt install python3
apt install py3-pip
- name: Install Requirements
run: |
pip install -r integration-tests/requirements.txt
- name: Tree
run: |
tree
- name: Start Containers
run: |
docker run -d -v $(pwd)/envoy.yaml:~/envoy/envoy.yaml -v $(pwd)/target/wasm32-wasi/release:~/envoy/proxy-wasm-plugins -p 10000:10000 docker.io/envoyproxy/envoy:v1.24-latest envoy -c ~/envoy/envoy.yaml --concurrency 1
cd integration-tests
docker run -d -p 80:80 docker.io/kennethreitz/httpbin
docker run -d -v $(pwd)/envoy.yaml:/etc/envoy/ -v $(pwd)/../target/wasm32-wasi/release:/etc/envoy/proxy-wasm-plugins -p 10000:10000 docker.io/envoyproxy/envoy:v1.24-latest envoy -c /etc/envoy/envoy.yaml --concurrency 1
- name: Run Integration tests
run: |
chromium-browser
chromedriver --silent
pytest test.py
chromedriver --silent &
chromium --no-sandbox --headless
pytest integration-tests/test.py
2 changes: 1 addition & 1 deletion envoy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ static_resources:
runtime: "envoy.wasm.runtime.v8"
code:
local:
filename: "~/envoy/proxy-wasm-plugins/wasm_oidc_plugin.wasm"
filename: "/etc/envoy/proxy-wasm-plugins/wasm_oidc_plugin.wasm"
- name: envoy.filters.http.router
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
Expand Down
2 changes: 1 addition & 1 deletion integration-tests/envoy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ static_resources:
runtime: "envoy.wasm.runtime.v8"
code:
local:
filename: "./envoy/proxy-wasm-plugins/wasm_oidc_plugin.wasm"
filename: "/etc/envoy/proxy-wasm-plugins/wasm_oidc_plugin.wasm"
- name: envoy.filters.http.router
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
Expand Down
6 changes: 5 additions & 1 deletion integration-tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ def set_up() -> None:
driver = webdriver.Chrome()

def login(driver: webdriver) -> None:
""" Logs in to the application. """

driver.get(BASE_URL)
driver.find_element(By.ID, "username").send_keys(WASM_OIDC_PLUGIN_TEST_EMAIL)
driver.find_element(By.ID, "password").send_keys(WASM_OIDC_PLUGIN_TEST_PASSWORD)
Expand All @@ -51,6 +53,8 @@ def login(driver: webdriver) -> None:
def tear_down() -> None:
"""Tears down the Selenium driver."""

driver.delete_all_cookies()

driver.quit()

# Tests
Expand Down Expand Up @@ -89,7 +93,7 @@ def test_modified_cookie() -> None:
set_up()
login(driver)
driver.delete_cookie("oidcSession-0")
driver.refresh()
driver.refresh()
assert driver.title != "httpbin.org"
tear_down()

Expand Down

0 comments on commit 2c94f98

Please sign in to comment.