Skip to content

Commit

Permalink
Move tests from no_visuals into simulation tests (#4367)
Browse files Browse the repository at this point in the history
Now you can properly inspect program memory for the no_visuals tests, instead of relying on a lot of KCL asserts.
  • Loading branch information
adamchalmers authored Nov 5, 2024
1 parent ad1cd56 commit 2abfbb9
Show file tree
Hide file tree
Showing 48 changed files with 22,862 additions and 359 deletions.
8 changes: 4 additions & 4 deletions .github/ci-cd-scripts/playwright-browser-chrome.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ set -euo pipefail
if [[ ! -f "test-results/.last-run.json" ]]; then
# if no last run artifact, than run plawright normally
echo "run playwright normally"
if [[ "$3" == "ubuntu-latest" ]]; then
if [[ "$3" == ubuntu-latest* ]]; then
yarn test:playwright:browser:chrome:ubuntu -- --shard=$1/$2 || true
elif [[ "$3" == "windows-latest" ]]; then
elif [[ "$3" == windows-latest* ]]; then
yarn test:playwright:browser:chrome:windows -- --shard=$1/$2 || true
else
echo "Do not run playwright. Unable to detect os runtime."
Expand All @@ -26,9 +26,9 @@ while [[ $retry -le $max_retrys ]]; do
if [[ $failed_tests -gt 0 ]]; then
echo "retried=true" >>$GITHUB_OUTPUT
echo "run playwright with last failed tests and retry $retry"
if [[ "$3" == "ubuntu-latest" ]]; then
if [[ "$3" == ubuntu-latest* ]]; then
yarn test:playwright:browser:chrome:ubuntu -- --last-failed || true
elif [[ "$3" == "windows-latest" ]]; then
elif [[ "$3" == windows-latest* ]]; then
yarn test:playwright:browser:chrome:windows -- --last-failed || true
else
echo "Do not run playwright. Unable to detect os runtime."
Expand Down
12 changes: 6 additions & 6 deletions .github/ci-cd-scripts/playwright-electron.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ set -euo pipefail
if [[ ! -f "test-results/.last-run.json" ]]; then
# if no last run artifact, than run plawright normally
echo "run playwright normally"
if [[ "$1" == "ubuntu-latest" ]]; then
if [[ "$1" == ubuntu-latest* ]]; then
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- yarn test:playwright:electron:ubuntu || true
elif [[ "$1" == "windows-latest" ]]; then
elif [[ "$1" == windows-latest* ]]; then
yarn test:playwright:electron:windows || true
elif [[ "$1" == "macos-14" ]]; then
elif [[ "$1" == macos-14* ]]; then
yarn test:playwright:electron:macos || true
else
echo "Do not run playwright. Unable to detect os runtime."
Expand All @@ -28,11 +28,11 @@ while [[ $retry -le $max_retrys ]]; do
if [[ $failed_tests -gt 0 ]]; then
echo "retried=true" >>$GITHUB_OUTPUT
echo "run playwright with last failed tests and retry $retry"
if [[ "$1" == "ubuntu-latest" ]]; then
if [[ "$1" == ubuntu-latest* ]]; then
xvfb-run --auto-servernum --server-args="-screen 0 1280x960x24" -- yarn test:playwright:electron:ubuntu -- --last-failed || true
elif [[ "$1" == "windows-latest" ]]; then
elif [[ "$1" == windows-latest* ]]; then
yarn test:playwright:electron:windows -- --last-failed || true
elif [[ "$1" == "macos-14" ]]; then
elif [[ "$1" == macos-14* ]]; then
yarn test:playwright:electron:macos -- --last-failed || true
else
echo "Do not run playwright. Unable to detect os runtime."
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/e2e-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
os: [ubuntu-latest-8-cores, windows-latest-8-cores]
shardIndex: [1, 2, 3, 4]
shardTotal: [4]
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -227,7 +227,7 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-14]
os: [ubuntu-latest-8-cores, windows-latest-8-cores, macos-14-large]
timeout-minutes: 60
runs-on: ${{ matrix.os }}
needs: check-rust-changes
Expand Down Expand Up @@ -287,7 +287,7 @@ jobs:
brew install gnu-sed
echo "/opt/homebrew/opt/gnu-sed/libexec/gnubin" >> $GITHUB_PATH
- name: Install vector
if: ${{ !startsWith(matrix.os, 'windows') }}
if: ${{ startsWith(matrix.os, 'ubuntu') }}
shell: bash
run: |
curl --proto '=https' --tlsv1.2 -sSfL https://sh.vector.dev > /tmp/vector.sh
Expand Down
2 changes: 1 addition & 1 deletion e2e/playwright/editor-tests.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -985,7 +985,7 @@ test.describe('Editor tests', () => {
|> extrude(5, %)`)
})

test(
test.fixme(
`Can use the import stdlib function on a local OBJ file`,
{ tag: '@electron' },
async ({ browserName }, testInfo) => {
Expand Down
6 changes: 3 additions & 3 deletions e2e/playwright/file-tree.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ test.describe('when using the file tree to', () => {
const fromFile = 'main.kcl'
const toFile = 'hello.kcl'

test(
test.fixme(
`rename ${fromFile} to ${toFile}, and doesn't crash on reload and settings load`,
{ tag: '@electron' },
async ({ browser: _, tronApp }, testInfo) => {
Expand Down Expand Up @@ -157,7 +157,7 @@ test.describe('when using the file tree to', () => {
}
)

test(
test.fixme(
`create many new untitled files they increment their names`,
{ tag: '@electron' },
async ({ browser: _, tronApp }, testInfo) => {
Expand Down Expand Up @@ -298,7 +298,7 @@ test.describe('when using the file tree to', () => {
}
)

test(
test.fixme(
'loading small file, then large, then back to small',
{
tag: '@electron',
Expand Down
2 changes: 1 addition & 1 deletion e2e/playwright/projects.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -854,7 +854,7 @@ test(
}
)

test(
test.fixme(
'Deleting projects, can delete individual project, can still create projects after deleting all',
{ tag: '@electron' },
async ({ browserName }, testInfo) => {
Expand Down
2 changes: 1 addition & 1 deletion e2e/playwright/snapshot-tests.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1031,7 +1031,7 @@ test.describe('Grid visibility', { tag: '@snapshot' }, () => {
})
})

test('theme persists', async ({ page, context }) => {
test.fixme('theme persists', async ({ page, context }) => {
const u = await getUtils(page)
await context.addInitScript(async () => {
localStorage.setItem(
Expand Down
2 changes: 1 addition & 1 deletion e2e/playwright/testing-settings.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ test.describe('Testing settings', () => {
)

// It was much easier to test the logo color than the background stream color.
test(
test.fixme(
'user settings reload on external change, on project and modeling view',
{ tag: '@electron' },
async ({ browserName }, testInfo) => {
Expand Down
Loading

0 comments on commit 2abfbb9

Please sign in to comment.