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

feat: init e2e test workflow for Package Manager Support #533

Merged
merged 57 commits into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
2f4e039
test: init e2e flow test
0618 Oct 25, 2023
04e6ee4
fix GH hash
0618 Oct 25, 2023
d88786b
use dynamic pkg manager
0618 Oct 25, 2023
c0eb0d4
setup nodejs with npm
0618 Oct 25, 2023
215acbf
setup more pkg managers
0618 Oct 25, 2023
95842bb
install pkg managers
0618 Oct 25, 2023
aaebae2
fix yarn1 and change step name
0618 Oct 25, 2023
45d990c
fix yarn1
0618 Oct 25, 2023
ee1c6c3
fix yarn1
0618 Oct 25, 2023
f856bb8
split yarn1 into 2 steps
0618 Oct 25, 2023
1b11e6e
fix yarn1
0618 Oct 25, 2023
fd937e1
fix yarn1 win
0618 Oct 25, 2023
6e6d06f
exclude bun on windows
0618 Oct 25, 2023
41c89ea
yarn1 windows
0618 Oct 25, 2023
c690620
setup yarn3
0618 Oct 25, 2023
fd2d010
yarn3
0618 Oct 25, 2023
f030ce0
yarn3 yarnPath
0618 Oct 25, 2023
974bfa6
yarn use 3rd party action
0618 Oct 25, 2023
a938e15
try yarn3
0618 Oct 26, 2023
c71302f
set yarn 3.6.x
0618 Oct 26, 2023
71af9a8
set yarn berry
0618 Oct 26, 2023
b28d8b9
set yarn stable and pass --yes
0618 Oct 26, 2023
b41bb05
feat: add env ci support
0618 Oct 26, 2023
e722f11
test: update unit tests
0618 Oct 26, 2023
7dca6da
feat: create amplify --yes option
0618 Oct 26, 2023
70fad76
chore: remove un-used code
0618 Oct 26, 2023
dc2df4b
feat: support Panage Manager env var
0618 Oct 26, 2023
c423170
chore: add comments
0618 Oct 27, 2023
518a43c
Merge branch 'main' into env-ci
0618 Oct 27, 2023
7b88772
chore: remove env.CI
0618 Oct 27, 2023
a085162
chore: update changeset
0618 Oct 27, 2023
988637e
chore: rename PACKAGE_MANAGER_EXECUTABLE
0618 Oct 27, 2023
be3a456
fix: tests
0618 Oct 27, 2023
fb7fa3f
Merge branch 'env-ci' into poc/e2e-test
0618 Oct 27, 2023
3d6d301
use Env Var PACKAGE_MANAGER_EXECUTABLE
0618 Oct 27, 2023
2b90bcc
Merge branch 'main' into poc/e2e-test
0618 Oct 27, 2023
4d3ebc3
fix npm -> npx, remove bun
0618 Oct 27, 2023
7ca0144
fix npm -> npx
0618 Oct 30, 2023
347dae0
change -- --yes
0618 Oct 30, 2023
c0b1bde
Merge branch 'main' into poc/e2e-test
0618 Oct 30, 2023
16fdea3
chore: update package.lock
0618 Oct 30, 2023
d3dc3ec
Merge branch 'update-package-lock' into poc/e2e-test
0618 Oct 30, 2023
3f0f5b2
chore: remove @alpha
0618 Oct 30, 2023
c3b7998
fix: clean up yarn
0618 Oct 30, 2023
a574541
fix: change yarn1 to yarn
0618 Oct 30, 2023
73ff607
chore: rename yarn step
0618 Oct 30, 2023
00b9499
chore: use env
0618 Oct 30, 2023
fbf5b1a
fix: yarn-stable env var
0618 Oct 30, 2023
9c6d8a6
add comments
0618 Oct 30, 2023
185be00
Merge branch 'main' into poc/e2e-test
0618 Oct 30, 2023
a59cf5a
Merge branch 'main' into poc/e2e-test
0618 Oct 31, 2023
3aba42f
Merge branch 'poc/package-manager-support' into poc/e2e-test
0618 Oct 31, 2023
633ec61
chore: update sample app with new imports (#541)
Amplifiyer Oct 31, 2023
863dc24
feat: use "use client"; directive in generated react components (#540)
sdstolworthy Oct 31, 2023
d0119b2
fix: flatten prop types auth (#534)
awsluja Oct 31, 2023
47d2a4f
Merge branch 'main' into poc/e2e-test
0618 Oct 31, 2023
3de87ad
chore: add TODO
0618 Oct 31, 2023
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
5 changes: 5 additions & 0 deletions .changeset/fuzzy-cooks-battle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@aws-amplify/form-generator': minor
---

Use "use client"; directive in generated React components
7 changes: 7 additions & 0 deletions .changeset/good-suns-rescue.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@aws-amplify/integration-tests': patch
'@aws-amplify/auth-construct-alpha': patch
'@aws-amplify/backend-auth': patch
---

Flatten loginWith type to improve autocompletion.
57 changes: 57 additions & 0 deletions .github/workflows/poc-e2e-flow-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Description: This workflow mimic the flow of behaviors when user using Amplify CLI;

name: 'poc-e2e-flow-test'

on: # TODO: need to change the trigger
push:
branches:
- poc/e2e-test
Comment on lines +5 to +8
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At some point we'll need to hook this up into health_checks.
Which means either stuffing this into health_checks OR investing in reusable workflow. See https://docs.github.com/en/actions/using-workflows/reusing-workflows (we did this for canaries in classic CLI).

@edwardfoyle what do you think? health_checks.yml started to be quite big.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can add it to health_checks once it's merged to main


jobs:
create-amplify-project:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should figure out how to change this from create-amplify-project to
run_e2e_with_package_manager , so that all e2e tests that do call package manager use it (sandbox, pipeline deploy in addition to create amplify).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it's a workflow, we can make is a re-usable GH workflow, however, it seems like just a shared workflow setup (metrics, etc), which I think we have to write it each time

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
node-version: [18]
pkg-manager: [npm, yarn, yarn-stable, pnpm]
runs-on: ${{ matrix.os }}
env:
PACKAGE_MANAGER_EXECUTABLE: ${{ matrix.pkg-manager }} # TODO: remove PACKAGE_MANAGER_EXECUTABLE once CLI is able to getPackageManager().
steps:
- name: Checkout aws-amplify/amplify-cli repo
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1. TODO: try only fetch .github/workflow
- name: Setup Node.js
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 #4.0.0
with:
node-version: ${{ matrix.node-version }}
cache: npm
- name: Local Publish create-amplify
shell: bash
run: npm run install:local && npm run build && npm run vend
- name: ${{matrix.pkg-manager}}-create-amplify-project
if: matrix.pkg-manager != 'yarn-stable'
shell: bash
run:
| # TODO: last step `create amplify` should be replaced by `run e2e`
mkdir -p /tmp/amplify-project; cd /tmp/amplify-project
npm install -g ${{matrix.pkg-manager}}
echo "$(${{matrix.pkg-manager}}) config set registry http://localhost:4873"
${{matrix.pkg-manager}} config set registry http://localhost:4873
echo "$(${{matrix.pkg-manager}}) config get registry"
${{matrix.pkg-manager}} config get registry
${{matrix.pkg-manager}} create amplify --yes

- name: yarn-stable-create-amplify-project
if: matrix.pkg-manager == 'yarn-stable'
shell: bash
run:
| # TODO: last step `create amplify` should be replaced by `run e2e`
mkdir -p /tmp/amplify-project; cd /tmp/amplify-project
corepack enable
echo "yarn set version stable"
yarn set version stable
echo "yarn version $(yarn --version)"
yarn config set unsafeHttpWhitelist localhost
yarn config set npmRegistryServer http://localhost:4873
PACKAGE_MANAGER_EXECUTABLE=yarn yarn create amplify --yes
2 changes: 1 addition & 1 deletion examples/simple_react/amplify/auth/resource.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineAuth } from '@aws-amplify/backend-auth';
import { defineAuth } from '@aws-amplify/backend';

export const auth = defineAuth({
loginWith: {
Expand Down
4 changes: 2 additions & 2 deletions examples/simple_react/amplify/backend.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { Backend } from '@aws-amplify/backend';
import { defineBackend } from '@aws-amplify/backend';
import { auth } from './auth/resource.js';
import { data } from './data/resource.js';

new Backend({
defineBackend({
auth,
data,
});
2 changes: 1 addition & 1 deletion examples/simple_react/amplify/data/resource.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineData } from '@aws-amplify/backend-graphql';
import { defineData } from '@aws-amplify/backend';

const schema = `
type Todo @model @auth(rules: [{ allow: private }]) {
Expand Down
Loading