Skip to content

Commit

Permalink
Cleanup tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
chadwcarlson committed Oct 28, 2023
1 parent 2a18fed commit 348d451
Showing 1 changed file with 20 additions and 22 deletions.
42 changes: 20 additions & 22 deletions .github/workflows/project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ jobs:
git config --global user.email "$TEST_USER_EMAIL"
git config --global user.name "$TEST_USER_NAME"
git branch
- name: "[create_project] 3. Set remote."
- name: "[create_project] 3. Set remote to the Upsun test project."
run: |
echo "::notice::Setting remote for the project locally."
TEST_PROJECT_ID=$(upsun project:list -o "$TEST_ORG_NAME" --title "$TEST_PROJECT_TITLE" --pipe)
Expand All @@ -126,46 +126,44 @@ jobs:
# Push through Git, not the CLI, so the exit doesn't break the workflow.
git push --force upsun $TEST_PROJECT_DEFAULT_BRANCH
# upsun push -f -y
- name: "[first_deploy] 2. Test: Verify first failure."
- name: "[first_deploy] 2. Test: The first deploy activity should complete."
run: |
cd $TEST_PROJECT_LOCALDIR
./utils/tests/activity_outcome.sh $TEST_PROJECT_DEFAULT_BRANCH push state complete "first_push"
- name: "[first_deploy] 3. Test: The first deploy activity should fail."
run: |
cd $TEST_PROJECT_LOCALDIR
# Verify complete.
./utils/tests/activity_outcome.sh $TEST_PROJECT_DEFAULT_BRANCH push state complete "first_push"
# Verify failure.
./utils/tests/activity_outcome.sh $TEST_PROJECT_DEFAULT_BRANCH push result failure "first_push"
- name: "[first_deploy] 3. Set initial resources."
################################################################################################
# D. Set initial resources.
- name: "[first_resources] 1. Set initial resources."
run: |
cd $TEST_PROJECT_LOCALDIR
upsun resources:set --size '*:0.1' -y
- name: "[first_deploy] 4. Test: verify activity completed."
- name: "[first_resources] 2. Test: The update environment resources activity should complete."
run: |
cd $TEST_PROJECT_LOCALDIR
# Verify complete.
./utils/tests/activity_outcome.sh $TEST_PROJECT_DEFAULT_BRANCH environment.resources.update state complete "first_push"
- name: "[first_deploy] 5. Test: verify activity has succeeded."
- name: "[first_resources] 3. Test: The update environment resources activity should succeed."
run: |
cd $TEST_PROJECT_LOCALDIR
# Verify success.
./utils/tests/activity_outcome.sh $TEST_PROJECT_DEFAULT_BRANCH environment.resources.update result success "first_push"
- name: "[first_deploy] 6. Test: production URLS & endpoint data."
- name: "[first_resources] 4. Test: Updating environment resources should result in a 200 on the frontend production app."
run: |
cd $TEST_PROJECT_LOCALDIR
# Verify frontend deployment successful.
TEST_PROJECT_PROD_URL_FRONTEND=$(upsun url --primary --pipe)
./utils/tests/url_status.sh $TEST_PROJECT_PROD_URL_FRONTEND '200' "production frontend deployment"
# Verify frontend deployment successful.
- name: "[first_resources] 5. Test: Updating environment resources should result in a 200 on the backend production app."
run: |
cd $TEST_PROJECT_LOCALDIR
TEST_PROJECT_PROD_URL_BACKEND=$TEST_PROJECT_PROD_URL_FRONTEND$TEST_PROJECT_BACKEND_PATH
./utils/tests/url_status.sh $TEST_PROJECT_PROD_URL_FRONTEND '200' "production frontend deployment"
./utils/tests/url_status.sh $TEST_PROJECT_PROD_URL_BACKEND '200' "production backend deployment"
- name: "[first_resources] 6. Test: endpoint data."
run: |
cd $TEST_PROJECT_LOCALDIR
EXPECTED_STATUS="file"
STATUS_DATA=$(curl -s $TEST_PROJECT_PROD_URL_BACKEND | jq -r '.session_storage')
if [ "$STATUS_DATA" != "$EXPECTED_STATUS" ]; then
Expand Down

0 comments on commit 348d451

Please sign in to comment.