Skip to content

Commit

Permalink
macOS e2e (#181)
Browse files Browse the repository at this point in the history
- E2E: add macOS to E2E, support using minikube by env var.
- E2E: Skip loading to docker before loading to minikube (load directly to minikube..)
- Support connections that start with tcp flags in addition to Syn (on macOS CI we saw CWR + NS)
  • Loading branch information
aviramha authored Jul 3, 2022
1 parent 78a5c36 commit f89055b
Show file tree
Hide file tree
Showing 9 changed files with 144 additions and 242 deletions.
54 changes: 47 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ jobs:
uses: docker/build-push-action@v3
with:
context: .
tag: test
tags: test
file: mirrord-agent/Dockerfile
outputs: type=docker,dest=/tmp/test.tar
cache-from: type=gha
Expand Down Expand Up @@ -145,6 +145,8 @@ jobs:
- uses: Swatinem/rust-cache@v1
with:
key: ubuntu-latest
cache-on-failure: true

- uses: actions/setup-node@v3
with:
node-version: 14
Expand All @@ -163,19 +165,57 @@ jobs:
with:
name: test
path: /tmp
- name: load image
run: docker load --input /tmp/test.tar
- run: docker image tag $(docker images | awk '{print $3}' | awk 'NR==2') test:latest
- run: minikube image load test:latest
- run: minikube image load /tmp/test.tar
- name: cargo test
run: cargo test -p tests
- name: switch minikube runtime
run: |
minikube delete
minikube start --container-runtime=docker
minikube image load test:latest
minikube image load /tmp/test.tar
- name: test with docker runtime
run: cargo test -p tests
- name: Collect logs
if: ${{ failure() }}
run: for FILE in $(docker exec minikube ls /var/log/containers); do docker exec minikube cat /var/log/containers/$FILE; done
run: for FILE in $(docker exec minikube ls /var/log/containers); do docker exec minikube cat /var/log/containers/$FILE; done

e2e_macos:
runs-on: macos-latest
name: e2e macOS
needs: [build_mirrord, test_agent_image]
env:
MIRRORD_AGENT_RUST_LOG: "warn,mirrord=debug"
USE_MINIKUBE: "true"
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly
components: rustfmt
- uses: Swatinem/rust-cache@v1
with:
key: macos-latest
cache-on-failure: true
- uses: actions/setup-node@v3
with:
node-version: 14
- run: npm install express
- uses: actions/setup-python@v3
- run: pip3 install flask
- name: setup cluster requirements
run: brew install hyperkit docker minikube
- name: start minikube
run: minikube start --driver=hyperkit --container-runtime=docker
- name: download image
uses: actions/download-artifact@v2
with:
name: test
path: /tmp
- name: load image
run: minikube image load /tmp/test.tar
- name: cargo test
run: cargo test -p tests
- name: Collect logs
if: ${{ failure() }}
run: docker logs $(docker ps -a | grep mirrord-agent | grep -v pause | head -n 1| cut -d' ' -f1)
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@ Check [Keep a Changelog](http://keepachangelog.com/) for recommendations on how

### Changed
- Refactor e2e, enable only Node HTTP mirroring test.
- E2E: add macOS to E2E, support using minikube by env var.
- E2E: Skip loading to docker before loading to minikube (load directly to minikube..)

### Fixed
- Support connections that start with tcp flags in addition to Syn (on macOS CI we saw CWR + NS)

## 2.3.1

Expand Down
Loading

0 comments on commit f89055b

Please sign in to comment.