https://github.com/iwdgo/testinghello
How to test Hello app
https://github.com/iwdgo/testinghello
gcp go golang handler hello offline testing tutorial
Last synced: 9 months ago
JSON representation
How to test Hello app
- Host: GitHub
- URL: https://github.com/iwdgo/testinghello
- Owner: iwdgo
- License: bsd-2-clause
- Created: 2018-09-09T06:23:24.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2023-11-02T18:03:52.000Z (over 2 years ago)
- Last Synced: 2024-06-21T11:46:19.896Z (almost 2 years ago)
- Topics: gcp, go, golang, handler, hello, offline, testing, tutorial
- Language: Go
- Homepage: https://pkg.go.dev/github.com/iwdgo/testinghello
- Size: 44.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://pkg.go.dev/github.com/iwdgo/testinghello)
[](https://goreportcard.com/report/github.com/iwdgo/testinghello)
[](https://codecov.io/gh/iwdgo/testinghello)
[](https://app.travis-ci.com/iwdgo/testinghello)
[](https://cirrus-ci.com/github/iwdgo/testinghello)
[](https://ci.appveyor.com/project/iwdgo/testinghello)
[](https://github.com/iwdgo/testinghello/actions/workflows/go.yml)
# Testing Hello!
Test of hello app can be done offline (server is not running) or online.
If online, it can be deployed locally (no network) or on a server.
Tests are performed:
- offline: by calling the handler directly. No server is started.
- online without network: by issuing an http request and verifying the response of the started website.
- online with network (app is deployed): by issuing an http request and verifying the response of the deployed website.
Use as standalone module:
- To start the site locally, use `src>go run .`
- use the standard set up (`app.yaml`) to deploy on Google Cloud which requires to create an account.
`src>gcloud app deploy app.yaml`
## Good to know
Coverage could be improved but the required complexity is beyond the scope of this repository.
Tagging remains on v1 as the purpose of the repository is to follow the evolution of Google Cloud and go language
on its topic.
## Release history
### v1.2.0
Minimal version is go 1.16 as deprecated `ioutil` package is migrated.
Flag `target` allows to override deployed URL like `go test -target=`
### v1.1.0
All previous solutions have been removed including comments as their use on GCP is deprecated
Previous release is tagged but requires ad hoc set up.
Further, `dev_appserver.py` does not provide support beyond go 1.11 and its use is removed.
All information regarding Google Cloud are removed as default runtime is several cycles after Go 1.11.
Repository is repurposed to test of a simple website.
### v1.0.0 Optional use of modules in various configuration.
Since `go 1.11` is available on GCP, the `app.yaml` is elementary.