You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@apisix.apache.org by su...@apache.org on 2021/03/24 13:58:42 UTC

[apisix-dashboard] branch master updated: feat: reset etcd before every test run (#1648)

This is an automated email from the ASF dual-hosted git repository.

sunyi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-dashboard.git


The following commit(s) were added to refs/heads/master by this push:
     new c6c5d14  feat: reset etcd before every test run (#1648)
c6c5d14 is described below

commit c6c5d147ef3e63a87a5f238aac8597357d2589d4
Author: litesun <su...@apache.org>
AuthorDate: Wed Mar 24 21:58:32 2021 +0800

    feat: reset etcd before every test run (#1648)
---
 web/cypress/support/index.js | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/web/cypress/support/index.js b/web/cypress/support/index.js
index 5a97ea8..a1d4cfc 100644
--- a/web/cypress/support/index.js
+++ b/web/cypress/support/index.js
@@ -17,6 +17,14 @@
 /* eslint-disable no-undef */
 import './commands';
 import '@cypress/code-coverage/support';
+const { SERVE_ENV = 'dev' } = Cypress.env();
+
+before(() => {
+  // reset etcd before test
+  if (SERVE_ENV === 'test') {
+    cy.exec('etcdctl del --prefix /', { failOnNonZeroExit: false });
+  }
+});
 
 Cypress.on('uncaught:exception', () => {
   // returning false here prevents Cypress from