Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BI-5255 Fix manual E2E: switch to ubuntu-latest; show logs; add teardown #356

Merged
merged 5 commits into from
Mar 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 18 additions & 21 deletions .github/workflows/run_e2e_on_ref_local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,28 @@ on:
jobs:
run_e2e:
name: "Build and run E2E"
runs-on: [ self-hosted, linux ]
runs-on: ubuntu-latest
permissions:
contents: read
packages: read
container:
image: "ghcr.io/${{ github.repository_owner }}/${{ github.event.repository.name }}/debian_docker:latest"
options: -v /var/run/docker.sock:/var/run/docker.sock
credentials:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Fix dubious ownership
run: .github/.scripts/git_config_save_directory.sh
env:
REPOSITORY_NAME: ${{ github.event.repository.name }}
- name: Checkout datalens-backend
uses: actions/checkout@v4
with:
path: datalens-backend

- name: Checkout datalens-ui
uses: actions/checkout@v4
with:
repository: datalens-tech/datalens-ui
path: datalens-ui

- name: Switch to PR head
working-directory: datalens-backend
run: gh pr checkout ${{ github.event.inputs.pr }}
env:
GH_TOKEN: ${{ github.token }}
- name: Validate SHA
working-directory: datalens-backend
run: |
export HEAD_SHA=$(git rev-parse HEAD)
export INPUT_SHA="${{ github.event.inputs.sha }}"
Expand All @@ -53,16 +53,13 @@ jobs:
with:
version: 3.33.1

- name: Checkout datalens-ui repo
uses: actions/checkout@v4
with:
repository: datalens-tech/datalens-ui
path: tools/e2e/datalens-ui
- uses: actions/setup-node@v3
with:
node-version: 18
cache: 'npm'
cache-dependency-path: tools/e2e/datalens-ui/package-lock.json
cache-dependency-path: datalens-ui/package-lock.json

- name: Build and run E2E
run: task e2e:init-and-run DATALENS_UI_FOLDER="./datalens-ui"
working-directory: datalens-backend
run: task e2e:init-and-run DATALENS_UI_FOLDER="../../../datalens-ui" SHOW_LOGS_WHEN_DONE=1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

run: ...
env:
...
?

# note: ^ ui path is relative to datalens-backend/tools/e2e
12 changes: 11 additions & 1 deletion tools/e2e/Taskfile.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -132,13 +132,23 @@ tasks:

init-and-run:
desc: Bootstrap command; install everything and run all tests; requires node installed
vars:
SHOW_LOGS_WHEN_DONE: '{{.SHOW_LOGS_WHEN_DONE | default "0"}}'
cmds:
- task: datalens-ui-repo-clone
- task: datalens-ui-repo-update
- task: datalens-ui-init
- task: docker-build
- defer: { task: docker-stop }
- defer: |
if [[ "{{.SHOW_LOGS_WHEN_DONE}}" == "1" ]]; then
docker ps -a
for i in $(docker ps -aq); do
echo $'\n\n'"Showing logs for container $i"
docker logs $i
done
fi
- task: docker-start
- task: test
vars:
RETRY_TIMES: 1
- task: docker-stop
Loading