Skip to content

Commit

Permalink
add git mocking for infer based deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
neel-astro committed Sep 18, 2024
1 parent 828a766 commit b7d8981
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
7 changes: 6 additions & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,11 @@ jobs:
secret_astronomer_host: ${{ secrets.ASTRONOMER_HOST }}
secret_astro_api_token: ${{ secrets.ASTRO_API_TOKEN }}

- name: Mock git commands
run: |
mv e2e-setup/mocks/image-deploy-git.sh /usr/local/bin/git
chmod +x /usr/local/bin/git
- name: Install dependencies
run: |
Expand All @@ -313,7 +318,7 @@ jobs:
with:
deployment-id: ${{ matrix.deployment_id }}
workspace: ${{ steps.get-astro-env-info.outputs.workspace_id }}
pytest: true
parse: true
action: deploy
root-folder: e2e-setup/astro-project

Expand Down
13 changes: 13 additions & 0 deletions e2e-setup/mocks/image-deploy-git.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash

# hack to mock git commands as part of action.yaml so that we could simulate image deploy scenario without making any additional commits

# Check if the script was invoked with "git diff"
if [[ "$1" == "diff" ]]; then
echo "e2e-setup/astro-project/Dockerfile"
elif [[ "$1" == "fetch" ]]; then
echo "Handling git fetch, doing nothing"
else
echo "Error: git mock script isn't configured to handle $1" >&2
exit 1
fi

0 comments on commit b7d8981

Please sign in to comment.