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

fix: Fix the new e2e action to be portable #3520

Merged
merged 2 commits into from
Jan 10, 2025
Merged
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
13 changes: 7 additions & 6 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,17 @@ inputs:
runs:
using: "composite"
steps:
- name: Go into self-hosted directory
shell: bash
run: cd ${{ github.action_path }}

- name: Configure to use the test image
if: inputs.project_name && inputs.image_url
shell: bash
run: |
image_var=$(echo ${{ inputs.project_name }}_IMAGE | tr '[:lower:]' '[:upper:]')
echo "${image_var}=${{ inputs.image_url }}" >> $GITHUB_ENV
echo "${image_var}=${{ inputs.image_url }}" >> ${{ github.action_path }}/.env

- name: Setup dev environment
shell: bash
run: |
cd ${{ github.action_path }}
pip install -r requirements-dev.txt
echo "PY_COLORS=1" >> "$GITHUB_ENV"
### pytest-sentry configuration ###
Expand Down Expand Up @@ -64,7 +61,7 @@ runs:
# Set permissions for docker volumes so we can cache and restore
sudo chmod o+x /var/lib/docker
sudo chmod -R o+rwx /var/lib/docker/volumes
source .env
source ${{ github.action_path }}/.env
SENTRY_IMAGE_SHA=$(docker buildx imagetools inspect $SENTRY_IMAGE --format "{{println .Manifest.Digest}}")
echo "SENTRY_IMAGE_SHA=$SENTRY_IMAGE_SHA" >> $GITHUB_OUTPUT
SNUBA_IMAGE_SHA=$(docker buildx imagetools inspect $SNUBA_IMAGE --format "{{println .Manifest.Digest}}")
Expand All @@ -88,6 +85,7 @@ runs:
SKIP_DB_MIGRATIONS: ${{ steps.restore_cache.outputs.cache-hit == 'true' && '1' || '' }}
shell: bash
run: |
cd ${{ github.action_path }}
# This is for the cache restore on Kafka to work in older releases
docker run --rm -v "sentry-kafka:/data" busybox chown -R 1000:1000 /data
# Add some customizations to test that path
Expand Down Expand Up @@ -132,18 +130,21 @@ runs:
/var/lib/docker/volumes/sentry-clickhouse \
/var/lib/docker/volumes/sentry-kafka \
"$RUNNER_TEMP/volumes/"
cd ${{ github.action_path }}
docker compose up --wait
TEST_CUSTOMIZATIONS=enabled pytest -x --cov --junitxml=junit.xml _integration-test/

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v5
if: inputs.CODECOV_TOKEN
with:
directory: ${{ github.action_path }}
token: ${{ inputs.CODECOV_TOKEN }}
slug: getsentry/self-hosted

- name: Upload test results to Codecov
if: inputs.CODECOV_TOKEN && !cancelled()
uses: codecov/test-results-action@v1
with:
directory: ${{ github.action_path }}
token: ${{ inputs.CODECOV_TOKEN }}
Loading