Skip to content
Merged
Show file tree
Hide file tree
Changes from 99 commits
Commits
Show all changes
123 commits
Select commit Hold shift + click to select a range
94cc3a8
consistency
FranjoMindek Aug 21, 2025
a4807aa
Merge branch 'main' into franjo/cli-testing
FranjoMindek Sep 4, 2025
32365a4
current
FranjoMindek Sep 4, 2025
257f648
kitchen sink works?
FranjoMindek Sep 4, 2025
81bc121
rel path
FranjoMindek Sep 4, 2025
7a8b90b
change name
FranjoMindek Sep 4, 2025
8870801
simplify
FranjoMindek Sep 4, 2025
8081572
HEAD -> working dir copy
FranjoMindek Sep 4, 2025
b271345
rename
FranjoMindek Sep 4, 2025
302dd36
changes
FranjoMindek Sep 4, 2025
c8b722f
remove test-outputs changes
FranjoMindek Sep 4, 2025
9706ac3
remove new
FranjoMindek Sep 4, 2025
c1d586b
change
FranjoMindek Sep 5, 2025
3d1a643
Revert "change"
FranjoMindek Sep 5, 2025
7ba2c51
move path stuff to common
FranjoMindek Sep 5, 2025
c346af2
naming
FranjoMindek Sep 5, 2025
02a23c9
changes
FranjoMindek Sep 8, 2025
5e62209
revert
FranjoMindek Sep 8, 2025
b575677
db
FranjoMindek Sep 8, 2025
638ccef
naming changes
FranjoMindek Sep 8, 2025
3eeaa8b
formatting
FranjoMindek Sep 8, 2025
b9bbed1
test docker build in CI without || true
FranjoMindek Sep 9, 2025
b4ec6f8
Merge branch 'main' into franjo/cli-testing
FranjoMindek Sep 10, 2025
d80cc08
fix + remove unused exports
FranjoMindek Sep 10, 2025
e740f1f
add checks
FranjoMindek Sep 10, 2025
164bcf5
comment
FranjoMindek Sep 10, 2025
acdaf5d
fix docker ommands
FranjoMindek Sep 11, 2025
0382c81
refactor paths, soruce changes
FranjoMindek Sep 11, 2025
7ed86d0
temp
FranjoMindek Sep 11, 2025
19a3d61
context test
FranjoMindek Sep 11, 2025
7715132
move
FranjoMindek Sep 12, 2025
d717706
comments
FranjoMindek Sep 12, 2025
befdafb
changes
FranjoMindek Sep 12, 2025
c809039
naming
FranjoMindek Sep 12, 2025
12998db
namings
FranjoMindek Sep 12, 2025
e895321
naming
FranjoMindek Sep 12, 2025
60e66d3
comments
FranjoMindek Sep 12, 2025
3ec1a2e
remove duplication
FranjoMindek Sep 15, 2025
25fd3cc
changes
FranjoMindek Sep 15, 2025
1740ca3
new structure
FranjoMindek Sep 16, 2025
fc3a63d
changes
FranjoMindek Sep 18, 2025
7e872fa
changes
FranjoMindek Sep 18, 2025
f6f43be
renaming to snapshot test
FranjoMindek Sep 22, 2025
02d4f4f
simplify
FranjoMindek Sep 22, 2025
a1d8515
comments
FranjoMindek Sep 22, 2025
1c14199
Merge branch 'main' into franjo/cli-testing
FranjoMindek Sep 22, 2025
5d6132a
naming
FranjoMindek Sep 22, 2025
55a641e
comment
FranjoMindek Sep 22, 2025
1868302
rename file
FranjoMindek Sep 22, 2025
285876c
common to filesystem
FranjoMindek Sep 22, 2025
4e56bbe
operators
FranjoMindek Sep 22, 2025
f6b9efa
siumplify
FranjoMindek Sep 23, 2025
47cb581
naming consistency
FranjoMindek Sep 23, 2025
2d5067f
break
FranjoMindek Sep 23, 2025
04f8262
changes
FranjoMindek Sep 23, 2025
e0d1090
different approach
FranjoMindek Sep 23, 2025
f521dc2
fix
FranjoMindek Sep 23, 2025
4ae3bfc
use abs path
FranjoMindek Sep 23, 2025
7f46150
name
FranjoMindek Sep 23, 2025
ba9deaa
make wasp app typesafe
FranjoMindek Sep 24, 2025
b1874e0
update readme
FranjoMindek Sep 26, 2025
82429f6
readme 2
FranjoMindek Sep 26, 2025
178a56d
remove project
FranjoMindek Sep 26, 2025
2455bf8
add current prefix
FranjoMindek Sep 26, 2025
68f1fe2
fix mistake
FranjoMindek Sep 26, 2025
d7e2b88
dot
FranjoMindek Sep 26, 2025
c9bdaa0
comment
FranjoMindek Sep 26, 2025
2a0ae9c
func to where
FranjoMindek Sep 26, 2025
830d827
name change
FranjoMindek Sep 26, 2025
9bb3c6b
cd instead of pushd popd
FranjoMindek Sep 26, 2025
c276219
extract
FranjoMindek Sep 26, 2025
fe0e4ea
rename
FranjoMindek Sep 26, 2025
e776ece
remove comment
FranjoMindek Sep 26, 2025
0cbee5c
refactor look
FranjoMindek Sep 26, 2025
ee2613c
back to array
FranjoMindek Sep 26, 2025
ad6d062
rename
FranjoMindek Sep 26, 2025
2293ff2
rename
FranjoMindek Sep 26, 2025
44b5ee6
explain file structure better
FranjoMindek Sep 26, 2025
cc9d56e
rename operator
FranjoMindek Sep 26, 2025
c197c3f
change context
FranjoMindek Sep 26, 2025
461f61f
renames
FranjoMindek Sep 26, 2025
521988e
renames
FranjoMindek Sep 26, 2025
c18717c
remove abs
FranjoMindek Sep 26, 2025
ba7ffbe
extract snapshot type
FranjoMindek Sep 26, 2025
961b395
remove conversion vars + rename
FranjoMindek Sep 26, 2025
dab6a41
towards StrongPath
FranjoMindek Sep 28, 2025
f8b1f00
yay type safety
FranjoMindek Sep 28, 2025
d90b68e
desc
FranjoMindek Sep 28, 2025
10cfe2f
sort out formatPackageJsonFiles
FranjoMindek Sep 28, 2025
eb74fa0
refactor work
FranjoMindek Sep 28, 2025
98952da
work
FranjoMindek Sep 29, 2025
d6d88d9
fix cd bug
FranjoMindek Sep 29, 2025
95fc787
refactor
FranjoMindek Sep 30, 2025
b19087f
name
FranjoMindek Sep 30, 2025
50aeca2
remove unused
FranjoMindek Sep 30, 2025
199791e
fix exports
FranjoMindek Sep 30, 2025
bac33d5
fix cabal files
FranjoMindek Sep 30, 2025
4bb574c
use existing file system for wasp app
FranjoMindek Oct 1, 2025
2926a56
rename WaspApp to WaspProject
FranjoMindek Oct 1, 2025
f9f17fe
improvements
FranjoMindek Oct 2, 2025
1548f2a
remove mnetion of wasp-app
FranjoMindek Oct 2, 2025
35594d6
simplify snapshot test a bit more
FranjoMindek Oct 2, 2025
ee2b480
change test-outputs for snapshots
FranjoMindek Oct 2, 2025
e4093bc
Merge branch 'main' into franjo/cli-testing
FranjoMindek Oct 2, 2025
67d528a
use od
FranjoMindek Oct 2, 2025
653ee4a
be explicit about the flag
FranjoMindek Oct 2, 2025
5e38035
readme
FranjoMindek Oct 8, 2025
5e45c7f
format
FranjoMindek Oct 8, 2025
c6d9b1e
log disk usage
FranjoMindek Oct 9, 2025
fe6429a
Merge branch 'main' into franjo/cli-testing
FranjoMindek Oct 9, 2025
6b9e903
Merge remote-tracking branch 'origin/main' into franjo/cli-testing
FranjoMindek Oct 9, 2025
7de0491
change
FranjoMindek Oct 9, 2025
4396db9
gitignore
FranjoMindek Oct 9, 2025
a5def3a
dont content check .env files (we random gen database on postgres)
FranjoMindek Oct 9, 2025
4427392
fix
FranjoMindek Oct 9, 2025
87502e0
format
FranjoMindek Oct 9, 2025
760a42c
MINOR FORMATTING
FranjoMindek Oct 9, 2025
a64ca50
format
FranjoMindek Oct 10, 2025
3cd8121
test
FranjoMindek Oct 10, 2025
ff6500f
Merge remote-tracking branch 'origin/main' into franjo/cli-testing
FranjoMindek Oct 10, 2025
9ddfb0c
no GHC no ormolu I sad
FranjoMindek Oct 10, 2025
1381c9e
Merge remote-tracking branch 'origin/main' into franjo/cli-testing
FranjoMindek Oct 10, 2025
1714812
update version in snapshots
FranjoMindek Oct 10, 2025
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
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ dist-newstyle/
waspc/data/packages/
waspc/data/*/templates/
waspc/data/Cli/starters/
waspc/e2e-tests/test-outputs/
waspc/e2e-tests/snapshots/
waspc/.bin
web/.docusaurus
web/build/
Expand Down
2 changes: 1 addition & 1 deletion waspc/.gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
# For .ps1 scripts on Win, it is important that their lines end with CRLF to execute correctly.
*.ps1 text eol=crlf

e2e-tests/test-outputs/*-golden/** linguist-generated=true
e2e-tests/snapshots/*-golden/** linguist-generated=true
waspls/tests/completionTests/*.golden linguist-generated=true
40 changes: 0 additions & 40 deletions waspc/e2e-tests/Common.hs

This file was deleted.

39 changes: 39 additions & 0 deletions waspc/e2e-tests/FileSystem.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
module FileSystem
( GitRepositoryRoot,
WaspcDir,
E2eTestsDir,
waspcDirInGitRoot,
getWaspcDirPath,
e2eTestsDirInWaspcDir,
getE2eTestsDir,
)
where

import Control.Monad (unless)
import StrongPath (Abs, Dir, Path', Rel, reldir, (</>))
import qualified StrongPath as SP
import System.Directory (getCurrentDirectory)
import System.FilePath (takeFileName)

data GitRepositoryRoot

data WaspcDir

data E2eTestsDir

waspcDirInGitRoot :: Path' (Rel GitRepositoryRoot) (Dir WaspcDir)
waspcDirInGitRoot = [reldir|waspc|]

getWaspcDirPath :: IO (Path' Abs (Dir WaspcDir))
getWaspcDirPath = do
-- NOTE: Cabal launches `cabal test` from root of the project, so this should always be some absolute path to waspc.
absCwd <- getCurrentDirectory
-- Just a little extra safeguard here since we are doing destructive file ops.
unless (takeFileName absCwd == "waspc") (error "Expecting test process to be invoked from waspc dir")
SP.parseAbsDir absCwd

e2eTestsDirInWaspcDir :: Path' (Rel WaspcDir) (Dir E2eTestsDir)
e2eTestsDirInWaspcDir = [reldir|e2e-tests|]

getE2eTestsDir :: IO (Path' Abs (Dir E2eTestsDir))
getE2eTestsDir = (</> e2eTestsDirInWaspcDir) <$> getWaspcDirPath
152 changes: 0 additions & 152 deletions waspc/e2e-tests/GoldenTest.hs

This file was deleted.

32 changes: 14 additions & 18 deletions waspc/e2e-tests/Main.hs
Original file line number Diff line number Diff line change
@@ -1,31 +1,27 @@
import GoldenTest (runGoldenTest)
import SnapshotTest (runSnapshotTest)
import System.Info (os)
import Test.Tasty (TestTree, defaultMain, testGroup)
import Tests.WaspBuildTest (waspBuild)
import Tests.WaspCompileTest (waspCompile)
import Tests.WaspComplexTest (waspComplexTest)
import Tests.WaspJobTest (waspJob)
import Tests.WaspMigrateTest (waspMigrate)
import Tests.WaspNewTest (waspNew)
import Tests.KitchenSinkSnapshotTest (kitchenSinkSnapshotTest)
import Tests.WaspBuildSnapshotTest (waspBuildSnapshotTest)
import Tests.WaspCompileSnapshotTest (waspCompileSnapshotTest)
import Tests.WaspMigrateSnapshotTest (waspMigrateSnapshotTest)
import Tests.WaspNewSnapshotTest (waspNewSnapshotTest)

main :: IO ()
main = do
if os == "mingw32"
then putStrLn "Skipping end-to-end tests on Windows due to tests using *nix-only commands"
else tests >>= defaultMain

-- TODO: Add more tests to simulate full Todo app tutorial.
-- Some of this requires waspStart and stdout parsing.
-- TODO: Investigate automatically discovering the tests.
tests :: IO TestTree
tests = do
testGroup "All Golden Dir Tests"
tests =
testGroup "Snapshot Tests"
<$> mapM
runGoldenTest
[ waspNew,
waspCompile,
waspMigrate,
waspBuild,
waspJob,
waspComplexTest
runSnapshotTest
[ waspNewSnapshotTest,
waspCompileSnapshotTest,
waspBuildSnapshotTest,
waspMigrateSnapshotTest,
kitchenSinkSnapshotTest
]
41 changes: 41 additions & 0 deletions waspc/e2e-tests/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# End-to-End tests for `waspc`

The purpose of these `e2e-tests` is to verify the functionality of the **`waspc` binary**.
We are not concerned with the internal implementation of the binary, only its interface and outputs.

## More on purpose

**Interface** is exposed through the Wasp CLI. We want to test the behavior of all of the Wasp CLI commands. These tests test behavior at the command level, rather than the internal implementation details.

The main **outputs** of the `waspc` binary are Wasp applications. We want to validate that CLI commands correctly generate or modify applications in line with expectations.
In addition to applications, we also cover secondary outputs, such as the installation and uninstallation of the CLI itself, `bash` completions, and more.

## Snapshot tests

We primarily test the `waspc` binary outputs using snapshot tests.
Snapshot tests compare the current test outputs (`current` snapshot) against the expected test outputs (`golden` snapshot).

Snapshots are compared in two ways:

1. **By existence**: a file must exists in both the `current` and the `golden` snapshot.
2. **By content**: the file contents must be identical in both the `current` and the `golden` snapshot.

For more details, check out the `waspc/e2e-tests/SnapshotTest.hs` file.

Snapshots are saved in the `waspc/e2e-tests/snapshots/` directory.
While the exact files within a snapshot aren’t strictly defined, they usually have the following structure:

```yaml
# Where:
# `<name>` = the snapshot test's name.
# `<snapshot-type>` = `current` or `golden`.

e2e-tests/
└── snapshots/
└── <name>-<snapshot-type>/ # snapshot dirctory, e.g. `wasp-build-current`, `wasp-build-golden`
├── wasp-app/
└── snapshot-file-list.manifest
```

`wasp-app` contains the Wasp app for that snapshot.
`snapshot-file-list.manifest` lists the files that should exist in the snapshot directory.
Loading
Loading