Files
virtual-kubelet/vendor/github.com/vmware/govmomi/govc/emacs/test/make.el
Loc Nguyen 513cebe7b7 VMware vSphere Integrated Containers provider (#206)
* Add Virtual Kubelet provider for VIC

Initial virtual kubelet provider for VMware VIC.  This provider currently
handles creating and starting of a pod VM via the VIC portlayer and persona
server.  Image store handling via the VIC persona server.  This provider
currently requires the feature/wolfpack branch of VIC.

* Added pod stop and delete.  Also added node capacity.

Added the ability to stop and delete pod VMs via VIC.  Also retrieve
node capacity information from the VCH.

* Cleanup and readme file

Some file clean up and added a Readme.md markdown file for the VIC
provider.

* Cleaned up errors, added function comments, moved operation code

1. Cleaned up error handling.  Set standard for creating errors.
2. Added method prototype comments for all interface functions.
3. Moved PodCreator, PodStarter, PodStopper, and PodDeleter to a new folder.

* Add mocking code and unit tests for podcache, podcreator, and podstarter

Used the unit test framework used in VIC to handle assertions in the provider's
unit test.  Mocking code generated using OSS project mockery, which is compatible
with the testify assertion framework.

* Vendored packages for the VIC provider

Requires feature/wolfpack branch of VIC and a few specific commit sha of
projects used within VIC.

* Implementation of POD Stopper and Deleter unit tests (#4)

* Updated files for initial PR
2018-06-04 15:41:32 -07:00

60 lines
2.9 KiB
EmacsLisp
Executable File

#!/usr/bin/env emacs --script
(let ((current-directory (file-name-directory load-file-name)))
(setq project-test-path (expand-file-name "." current-directory))
(setq project-root-path (expand-file-name ".." current-directory)))
(add-to-list 'load-path project-root-path)
(add-to-list 'load-path project-test-path)
(require 'lisp-mnt)
(require 'govc)
(require 's)
(defun make-test ()
(dolist (test-file (or argv (directory-files project-test-path t "-test.el$")))
(load test-file nil t))
(ert-run-tests-batch-and-exit t))
(defun govc-help ()
"Summary of govc modes in markdown format."
(interactive)
(with-help-window (help-buffer) ; TODO: this turned into a mess, but does the job of generating README.md from govc.el
(dolist (kind '(govc-mode govc-urls
govc-session-url govc-session-insecure govc-session-datacenter govc-session-datastore govc-session-network
tabulated-list host pool datastore datastore-ls vm device object metric))
(let* ((name (if (boundp kind) (symbol-name kind) (format "govc-%s-mode" kind)))
(map (if (equal 'govc-mode kind) 'govc-command-map (intern (concat name "-map"))))
(doc (lambda (f &optional all)
(let* ((txt (if (functionp f) (documentation f t) (documentation-property f 'variable-documentation)))
(ix (if all (length txt) (s-index-of "." txt))))
(s-replace (format "\n\n\\\{%s\}" (concat name "-map")) ""
(s-replace "'" "`" (substring txt 0 ix)))))))
(princ (concat (s-repeat (if (and (boundp kind) (not (fboundp kind))) 3 2) "#") " " name "\n"))
(princ (concat "\n" (funcall doc (intern name) t) "\n\n"))
(when (boundp map)
(princ (concat "### " (symbol-name map) "\n\n"))
(princ "Keybinding | Description\n")
(princ "---------------|------------------------------------------------------------\n")
(dolist (kl (govc-keymap-list (symbol-value map)))
(let ((key (govc-key-description (car kl))))
(princ (format "<kbd>%s</kbd>%s| %s\n" key (s-repeat (- 4 (length key)) " ") (funcall doc (nth 2 kl))))))
(princ "\n"))))))
(defun make-docs ()
(let ((commentary)
(summary))
(with-current-buffer (find-file-noselect (concat project-root-path "/govc.el"))
(setq commentary (s-replace ";;; Commentary:" "" (lm-commentary))
summary (lm-summary)))
(let ((readme (find-file-noselect (concat project-root-path "/README.md"))))
(with-current-buffer readme
(erase-buffer)
(govc-help)
(with-current-buffer (help-buffer)
(copy-to-buffer readme (point-min) (point-max)))
(goto-char (point-min))
(insert (concat "# govc.el\n\n" summary ".\n"))
(insert (s-replace "'" "`" (replace-regexp-in-string ";; ?" "" commentary t t)))
(save-buffer 0)))))