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

13/09 Daily Promotion #36317

Merged
merged 16 commits into from
Sep 13, 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
86 changes: 66 additions & 20 deletions .github/workflows/build-client-server-count.yml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ jobs:
with:
pr: ${{fromJson(needs.file-check.outputs.pr)}}
run_count: ${{fromJson(needs.file-check.outputs.run_count)}}


ci-test-limited-existing-docker-image:
needs: [file-check]
Expand Down Expand Up @@ -260,39 +261,62 @@ jobs:
with:
name: cypress-repeat-logs
path: app/client

- name: Download the ci_test_status
uses: actions/download-artifact@v4
with:
name: ci_test_status
path: app/client

- name: Read and Set File Content as ENV Variable
id: set-summary-content
run: |
summary_content=$(cat app/client/cy-repeat-summary.txt | tr '\n' ' ')
echo "summary_content=$summary_content" >> $GITHUB_ENV
echo "summary_content=$summary_content" >> $GITHUB_ENV

- name: Check CI Test Result
id: check-ci-test
run: |
# Check if the ci_test_failed flag is set
if [ -f app/client/ci_test_status.txt ]; then
if grep -q "ci_test_failed=true" app/client/ci_test_status.txt; then
echo "Tests failed. Please review the test results."
echo "ci_test_failed=true" >> $GITHUB_ENV
else
echo "Tests passed."
echo "ci_test_failed=false" >> $GITHUB_ENV
fi
else
echo "ci_test_status.txt file not found."
echo "ci_test_failed=unknown" >> $GITHUB_ENV
fi

- name: Add a comment on the PR with new CI failures
if: needs.ci-test-limited.result != 'success' && needs.file-check.outputs.pr != '0'
if: env.ci_test_failed != 'true' && needs.file-check.outputs.pr != '0'
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{fromJson(needs.file-check.outputs.pr)}}
body: |
Workflow run: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}>.
Cypress dashboard: <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=${{ github.run_id }}&attempt=${{ github.run_attempt }}&selectiontype=test&testsstatus=failed&specsstatus=fail" target="_blank"> Click here!</a>
The following are new failures, please fix them before merging the PR: ${{env.new_failed_spec_env}}
To know the list of identified flaky tests - <a href="https://internal.appsmith.com/app/cypress-dashboard/identified-flaky-tests-65890b3c81d7400d08fa9ee3?branch=master" target="_blank">Refer here</a>
```
${{ env.summary_content }}
```

- name: Add a comment on the PR when ci-test-limited is success
if: needs.ci-test-limited.result == 'success' && needs.file-check.outputs.pr != '0'
Workflow run: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}>.
Cypress dashboard: <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=${{ github.run_id }}&attempt=${{ github.run_attempt }}&selectiontype=test&testsstatus=failed&specsstatus=fail" target="_blank">Click here!</a>
The following are new failures, please fix them before merging the PR: ${{env.new_failed_spec_env}}
To know the list of identified flaky tests - <a href="https://internal.appsmith.com/app/cypress-dashboard/identified-flaky-tests-65890b3c81d7400d08fa9ee3?branch=master" target="_blank">Refer here</a>
```
${{ env.summary_content }}
```
- name: Add a comment on the PR when ci-test-limited is successful
if: env.ci_test_failed == 'true' && needs.file-check.outputs.pr != '0'
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{fromJson(needs.file-check.outputs.pr)}}
body: |
Workflow run: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}>.
Cypress dashboard url: <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=${{ github.run_id }}&attempt=${{ github.run_attempt }}" target="_blank">Click here!</a>
All cypress tests have passed 🎉🎉🎉
```
${{ env.summary_content }}
```
Workflow run: <${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}>.
Cypress dashboard url: <a href="https://internal.appsmith.com/app/cypress-dashboard/rundetails-65890b3c81d7400d08fa9ee5?branch=master&workflowId=${{ github.run_id }}&attempt=${{ github.run_attempt }}" target="_blank">Click here!</a>
All Cypress tests have passed 🎉🎉🎉
```
${{ env.summary_content }}
```

- name: Check ci-test-limited set status
if: needs.ci-test-limited.result != 'success'
Expand Down Expand Up @@ -396,16 +420,38 @@ jobs:
with:
name: cypress-repeat-logs
path: app/client

- name: Download the ci_test_status
uses: actions/download-artifact@v4
with:
name: ci_test_status
path: app/client

- name: Read and Set File Content as ENV Variable
id: set-summary-content
run: |
summary_content=$(cat app/client/cy-repeat-summary.txt | tr '\n' ' ')
echo "summary_content=$summary_content" >> $GITHUB_ENV

- name: Check CI Test Result
id: check-ci-test
run: |
# Check if the ci_test_failed flag is set
if [ -f app/client/ci_test_status.txt ]; then
if grep -q "ci_test_failed=true" app/client/ci_test_status.txt; then
echo "Tests failed. Please review the test results."
echo "ci_test_failed=true" >> $GITHUB_ENV
else
echo "Tests passed."
echo "ci_test_failed=false" >> $GITHUB_ENV
fi
else
echo "ci_test_status.txt file not found."
echo "ci_test_failed=unknown" >> $GITHUB_ENV
fi

- name: Add a comment on the PR with new CI failures
if: needs.ci-test-limited-existing-docker-image.result != 'success' && needs.file-check.outputs.pr != '0'
if: env.ci_test_failed != 'true' && needs.file-check.outputs.pr != '0'
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{fromJson(needs.file-check.outputs.pr)}}
Expand All @@ -419,7 +465,7 @@ jobs:
```

- name: Add a comment on the PR when ci-test-limited-existing-docker-image is success
if: needs.ci-test-limited-existing-docker-image.result == 'success' && needs.file-check.outputs.pr != '0'
if: env.ci_test_failed == 'true' && needs.file-check.outputs.pr != '0'
uses: peter-evans/create-or-update-comment@v3
with:
issue-number: ${{fromJson(needs.file-check.outputs.pr)}}
Expand Down
39 changes: 26 additions & 13 deletions .github/workflows/ci-test-limited-with-count.yml
Original file line number Diff line number Diff line change
Expand Up @@ -350,12 +350,17 @@ jobs:
--spec ${{ env.specs_to_run }} \
--config-file "cypress_ci_custom.config.ts"
cat cy-repeat-summary.txt
# Check if "Total Failed: 0" is present
# Define the path for the failure flag file
FAILURE_FLAG_FILE="ci_test_status.txt"

# Check for test results and store the status in the file
if ! grep -q "Total Failed: 0" cy-repeat-summary.txt; then
echo "Tests failed, failing the GitHub Action."
exit 1 # Fails the step if tests failed
fi

echo "ci_test_failed=true" > "$FAILURE_FLAG_FILE"
else
echo "ci_test_failed=false" > "$FAILURE_FLAG_FILE"
fi
cat "$FAILURE_FLAG_FILE"

- name: Trim number of cypress log files
if: failure()
run: |
Expand All @@ -368,9 +373,17 @@ jobs:
name: cypress-repeat-logs
path: ${{ github.workspace }}/app/client/cy-repeat-summary.txt
overwrite: true

- name: Upload ci_test_status.txt artifact
if: always()
uses: actions/upload-artifact@v4
with:
name: ci_test_status
path: ${{ github.workspace }}/app/client/ci_test_status.txt
overwrite: true

- name: Upload failed test cypress logs artifact
if: failure()
if: always()
uses: actions/upload-artifact@v4
with:
name: cypress-console-logs
Expand All @@ -386,29 +399,29 @@ jobs:
overwrite: true

- name: Collect CI container logs
if: failure()
if: always()
working-directory: "."
run: |
mkdir -p ~/dockerlogs
docker logs appsmith 2>&1 > ~/dockerlogs/dockerlogs-log.txt

# Upload docker logs
- name: Upload failed test list artifact
if: failure()
if: always()
uses: actions/upload-artifact@v4
with:
name: dockerlogs
path: ~/dockerlogs
overwrite: true

- name: Rename reports
if: failure()
if: always()
run: |
mkdir -p ~/results
mv ${{ github.workspace }}/app/client/results ~/results

- name: Upload cypress report
if: failure()
if: always()
uses: actions/upload-artifact@v4
with:
name: results-${{github.run_attempt}}
Expand All @@ -417,13 +430,13 @@ jobs:

# Set status = failedtest
- name: Set fail if there are test failures
if: failure()
if: always()
run: |
echo "failedtest" > ~/run_result

# Force store previous run result to cache
- name: Store the previous run result
if: failure()
if: always()
uses: actions/cache/save@v4
with:
path: |
Expand All @@ -433,7 +446,7 @@ jobs:
# Upload the log artifact so that it can be used by the test & deploy job in the workflow
- name: Upload server logs bundle on failure
uses: actions/upload-artifact@v4
if: failure()
if: always()
with:
name: server-logs
path: app/server/server-logs.log
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ jobs:
push-image:
needs: [client-build, rts-build, server-build]
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write

if: success()
steps:
# Check out merge commit
Expand Down Expand Up @@ -176,6 +180,9 @@ jobs:
scripts/prepare_server_artifacts.sh
fi

- name: Set up Depot CLI
uses: depot/setup-action@v1

- name: Login to DockerHub
uses: docker/login-action@v1
with:
Expand All @@ -193,11 +200,12 @@ jobs:
echo "base_tag=$base_tag" >> $GITHUB_OUTPUT

- name: Push to Docker Hub
uses: docker/build-push-action@v4
uses: depot/build-push-action@v1
with:
context: .
pull: true
push: true
platforms: linux/arm64,linux/amd64
cache-from: ${{ vars.DOCKER_HUB_ORGANIZATION }}/appsmith-${{ vars.EDITION }}:release
tags: |
${{ vars.DOCKER_HUB_ORGANIZATION }}/appsmith-dp:${{ vars.EDITION }}-${{ github.event.client_payload.pull_request.number }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,17 +36,7 @@ describe(
anvilSnapshot.setAccentColor("#0080ff");
});

it("3. Typography", () => {
anvilSnapshot.setTypography("Inter");

anvilSnapshot.matchSnapshotForCanvasMode("AppThemingTypography");
anvilSnapshot.matchSnapshotForPreviewMode("AppThemingTypography");
anvilSnapshot.matchSnapshotForDeployMode("AppThemingTypography");

anvilSnapshot.setTypography("System Default");
});

it("4. Density", () => {
it("3. Density", () => {
["Tight", "Regular", "Loose"].forEach((density) => {
anvilSnapshot.setDensity(density);

Expand All @@ -58,7 +48,7 @@ describe(
});
});

it("5. Sizing", () => {
it("4. Sizing", () => {
["Small", "Regular", "Big"].forEach((size) => {
anvilSnapshot.setSizing(size);

Expand All @@ -68,7 +58,7 @@ describe(
});
});

it("6. Corners", () => {
it("5. Corners", () => {
["0px", "6px", "20px"].forEach((corner) => {
anvilSnapshot.setCorners(corner);

Expand All @@ -77,15 +67,5 @@ describe(
anvilSnapshot.matchSnapshotForDeployMode(`AppThemingCorner${corner}`);
});
});

it("7. Icon Style", () => {
["Filled", "Outlined"].forEach((iconStyle) => {
anvilSnapshot.setIconStyle(iconStyle);

anvilSnapshot.matchSnapshotForCanvasMode(`AppThemingIcon${iconStyle}`);
anvilSnapshot.matchSnapshotForPreviewMode(`AppThemingIcon${iconStyle}`);
anvilSnapshot.matchSnapshotForDeployMode(`AppThemingIcon${iconStyle}`);
});
});
},
);
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ let repoName: string = "TED-testrepo1";

describe(
"Git Autocommit",
{ tags: ["@tag.Git", "@tag.GitAutocommit"] },
{ tags: ["@tag.Git", "@tag.GitAutocommit", "@tag.excludeForAirgap"] },
function () {
it("Check if autocommit progress bar is visible and network requests are properly called", function () {
featureFlagIntercept({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,10 @@ describe(
});

it("11. Verify table search includes label and value for table with select column type", () => {
deployMode.NavigateBacktoEditor();
// This flag is turned on to allow the label show in the table select cell content
// when this feature is turned on fully, this flag will be removed
featureFlagIntercept({ release_table_cell_label_value_enabled: true });
deployMode.NavigateBacktoEditor();
EditorNavigation.SelectEntityByName("Table1", EntityType.Widget);
propPane.EnterJSContext("Table data", demoTableDataForSelect);

Expand Down
9 changes: 0 additions & 9 deletions app/client/cypress/support/Pages/Anvil/AnvilSnapshot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export class AnvilSnapshot {
densityOptions: "[data-testid=t--anvil-theme-settings-density] > div",
sizingOptions: "[data-testid=t--anvil-theme-settings-sizing] > div",
cornersOptions: "[data-testid=t--anvil-theme-settings-corners] > div",
iconStyleOptions: "[data-testid=t--anvil-theme-settings-icon-style] > div",
};

/**
Expand Down Expand Up @@ -163,14 +162,6 @@ export class AnvilSnapshot {
});
};

public setIconStyle = (iconStyle: string) => {
this.updateThemeOption(() => {
cy.get(this.locators.iconStyleOptions)
.contains(iconStyle)
.click({ force: true });
});
};

public updateThemeOption = (callback: () => void) => {
this.appSettings.OpenAppSettings();
this.appSettings.GoToThemeSettings();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ export * from "./useSpacing";
export * from "./useTypography";
export * from "./useTheme";
export * from "./useCssTokens";
export * from "./useIconDensity";
export * from "./useIconSizing";
Loading
Loading