Firebase 运行依赖firestore emulator的CI测试
我有一些安全测试,可以在firestore模拟器上本地运行。过程如下所示:Firebase 运行依赖firestore emulator的CI测试,firebase,google-cloud-firestore,github-actions,firebase-cli,Firebase,Google Cloud Firestore,Github Actions,Firebase Cli,我有一些安全测试,可以在firestore模拟器上本地运行。过程如下所示: - name: Test Security Rules run: | firebase emulators:start --only firestore yarn test rules 在终端选项卡1中,启动仿真器: firebase emulators:start --only firestore 在终端选项卡2中,运行测试 yarn test rules 我希望将这些测试作为CI的GitHu
- name: Test Security Rules
run: |
firebase emulators:start --only firestore
yarn test rules
在终端选项卡1中,启动仿真器:
firebase emulators:start --only firestore
在终端选项卡2中,运行测试
yarn test rules
我希望将这些测试作为CI的GitHub操作运行。目前看起来是这样的:
- name: Test Security Rules
run: |
firebase emulators:start --only firestore
yarn test rules
问题是启动模拟器不会返回,因此它会挂起并最终超时
emulators: All emulators started, it is now safe to connect.
我希望了解如何启动模拟器,知道它何时准备好(或等待N秒),运行测试,然后(可选)关闭进程。请阅读。您需要使用模拟器:exec
参数:
启动Firebase.json中配置的Firebase产品的模拟器后,在scriptpath上运行脚本。脚本完成运行后,Emulator进程将自动停止
如果您将要运行的命令的名称传递给它,CLI将在命令准备就绪后为您运行该命令,然后在脚本完成后结束该过程。您是否成功完成了此操作?我仍在尝试在Github上运行此操作。。。见我的帖子。。并在github上发布了该问题。。