-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: add integration test for
create fuels
(#2489)
- Loading branch information
1 parent
04b58e2
commit 2290935
Showing
11 changed files
with
114 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"create-fuels": patch | ||
--- | ||
|
||
chore: add integration test for `create fuels` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
#!/bin/bash | ||
|
||
# The PUBLISHED_NPM_VERSION variable is required to create a new project with the current published `fuels` version | ||
PUBLISHED_NPM_VERSION="${PUBLISHED_NPM_VERSION-"next"}" | ||
|
||
# Versions | ||
FUEL_CORE_VERSION=$(cat ./internal/fuel-core/VERSION) | ||
FORC_VERSION=$(cat ./internal/forc/VERSION) | ||
TOOLCHAIN="CI" | ||
|
||
# Project | ||
ROOT_DIR=$(pwd) | ||
PLAYWRIGHT_DIR="$ROOT_DIR" | ||
PROJECT_DIR="$ROOT_DIR/test-project" | ||
|
||
echo "1. Install toolchains" | ||
if [ -x "$(command -v fuelup)" ]; then | ||
echo "Fuelup exists" | ||
else | ||
echo "Fuelup does not exist - installing 'fuelup'" | ||
curl -fsSL https://install.fuel.network/ | sh -s -- --no-modify-path | ||
export PATH="${HOME}/.fuelup/bin:${PATH}" | ||
fi | ||
|
||
fuelup toolchain new $TOOLCHAIN | ||
fuelup default $TOOLCHAIN | ||
fuelup component add fuel-core@$FUEL_CORE_VERSION | ||
fuelup component add forc@$FORC_VERSION | ||
|
||
echo "2. Scaffold a new project with 'create fuels@$PUBLISHED_NPM_VERSION'" | ||
if [ -d "$PROJECT_DIR" ]; then | ||
echo "Removing existing project directory '$PROJECT_DIR'" | ||
rm -rf $PROJECT_DIR | ||
fi | ||
pnpm create fuels@$PUBLISHED_NPM_VERSION $PROJECT_DIR --pnpm -cps --no-install | ||
|
||
echo "3. Intialise the project" | ||
cd $PROJECT_DIR | ||
pnpm add fuels@$PUBLISHED_NPM_VERSION > /dev/null 2>&1 | ||
pnpm --ignore-workspace install > /dev/null 2>&1 | ||
cp .env.example .env.local | ||
|
||
echo "4. Running UI tests" | ||
cd $ROOT_DIR | ||
PROJECT_DIR=$PROJECT_DIR sh ./scripts/tests-ui.sh | ||
TEST_RESULT=$? | ||
|
||
rm -rf $PROJECT_DIR | ||
|
||
exit $TEST_RESULT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
ROOT_DIR=$(pwd) | ||
PLAYWRIGHT_DIR="$ROOT_DIR" | ||
PROJECT_DIR="${PROJECT_DIR-"$ROOT_DIR/templates/nextjs"}" | ||
|
||
cd $PROJECT_DIR && pnpm run fuels:dev > /dev/null 2>&1 & | ||
sleep 5 | ||
|
||
cd $PROJECT_DIR && pnpm run dev > /dev/null 2>&1 & | ||
sleep 5 | ||
|
||
cd $PLAYWRIGHT_DIR | ||
pnpm exec playwright install --with-deps | ||
pnpm exec playwright test | ||
|
||
pkill next-server | ||
pkill fuel-core |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters