Просмотр исходного кода

[Feature] Add support for automated testing (#1990)

* Setup drone file for drone server
* Move check_php.sh from ./src/ to ./test/
* Changes have been made to v-add-mail-domain
* Update secrets
Jaap Marcus 4 лет назад
Родитель
Сommit
aeaaeb37d3
3 измененных файлов с 82 добавлено и 1 удалено
  1. 75 0
      .drone.ylm
  2. 0 0
      test/check_php.sh
  3. 7 1
      test/test.bats

+ 75 - 0
.drone.ylm

@@ -0,0 +1,75 @@
+---
+kind: pipeline
+type: ssh
+name: default
+
+concurrency:
+  limit: 1
+
+server:
+  host:
+    from_secret: server_address
+  user: 
+    from_secret: username
+  ssh_key: 
+    from_secret: ssh_key
+
+platform:
+  os: linux
+  arch: amd64
+   
+steps:
+- name: submodules
+  image: alpine/git
+  commands:
+  - git submodule update --init --recursive
+- name: build-install
+  commands:
+  - ./src/hst_autocompile.sh --hestia --install '~localsrc'
+- name: bast-test
+  commands:
+  - bats ./test/test.bats
+- name: php-test
+  commands: 
+  - ./test/check_php.php
+
+trigger:
+  event: [ push ]
+
+---      
+kind: pipeline
+type: ssh
+name: pull-request
+
+concurrency:
+      limit: 1
+
+server:
+  host:
+    from_secret: server_address
+  user: 
+    from_secret: username
+  ssh_key: 
+    from_secret: ssh_key
+
+platform:
+      os: linux
+      arch: amd64
+
+steps:
+- name: submodules
+  image: alpine/git
+  commands:
+  - git submodule update --init --recursive
+- name: build-install
+  commands:
+  - ./src/hst_autocompile.sh --hestia --install '~localsrc'
+- name: bast-test
+  commands:
+  - bats ./test/test.bats
+- name: php-test
+  commands: 
+  - ./test/check_php.php
+
+trigger:
+  event: [ pull_request ]

+ 0 - 0
src/check_php.sh → test/check_php.sh


+ 7 - 1
test/test.bats

@@ -914,7 +914,13 @@ function validate_database(){
     run v-add-mail-domain $user $domain
     assert_success
     refute_output
+}
 
+@test "MAIL: Add mail domain webmail client" {
+    skip 
+    run v-add-mail-domain-webmail $user $domain "rouncube"
+    assert_success
+    refute_output
     validate_mail_domain $user $domain
 
     # echo -e "<?php\necho 'Server: ' . \$_SERVER['SERVER_SOFTWARE'];" > /var/lib/roundcube/check_server.php
@@ -950,7 +956,7 @@ function validate_database(){
 }
 
 #----------------------------------------------------------#
-#    Limit possibilities adding different owner domain    #
+#    Limit possibilities adding different owner domain     #
 #----------------------------------------------------------#
 
 @test "Allow Users: User can't add user.user2.com " {