{"id":19865634,"url":"https://github.com/openfaas/certifier","last_synced_at":"2025-05-02T05:31:46.699Z","repository":{"id":25157797,"uuid":"103325110","full_name":"openfaas/certifier","owner":"openfaas","description":"OpenFaaS Compliance testing","archived":false,"fork":false,"pushed_at":"2022-04-06T09:02:09.000Z","size":1253,"stargazers_count":26,"open_issues_count":7,"forks_count":14,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-06T23:06:07.757Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/openfaas.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-12T22:08:03.000Z","updated_at":"2024-10-18T09:13:14.000Z","dependencies_parsed_at":"2022-08-07T11:15:22.046Z","dependency_job_id":null,"html_url":"https://github.com/openfaas/certifier","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfaas%2Fcertifier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfaas%2Fcertifier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfaas%2Fcertifier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/openfaas%2Fcertifier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/openfaas","download_url":"https://codeload.github.com/openfaas/certifier/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251992920,"owners_count":21677022,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-12T15:23:31.155Z","updated_at":"2025-05-02T05:31:41.690Z","avatar_url":"https://github.com/openfaas.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# certifier for OpenFaaS\n\n[![Build Status](https://travis-ci.com/openfaas/certifier.svg?branch=master)](https://travis-ci.com/openfaas/certifier)\n[![OpenFaaS](https://img.shields.io/badge/openfaas-serverless-blue.svg)](https://www.openfaas.com)\n\nThe purpose of this project is to certify that an OpenFaaS provider is doing what it should in response to the RESTful API.\n\n## Usage\n\nThe tests assume a local environment with basic authentication turned off.\n\n### Auth\nThe test _can_ use auth by setting an explicit Bearer token using the `-token` flag or by  reading the CLI config when you set the `-enableAuth` flag.\n\n```sh\necho -n $PASSWORD | faas-cli login --gateway=$OPENFAAS_URL --username admin --password-stdin\ngo test - v ./tests -enableAuth -gateway=$OPENFAAS_URL\n```\n\n### Kubernetes\n\nUsage with local Kubernetes cluster:\n\n```sh\nexport OPENFAAS_URL=http://127.0.0.1:31112/\nmake test-kubernetes\n```\n\nYou will need to have access to `kubectl` for creating and cleaning state.\n\nIf you have enabled auth in your cluster, first login with the `faas-cli` and then use\n\n```sh\nexport OPENFAAS_URL=http://127.0.0.1:31112/\nmake test-kubernetes .FEATURE_FLAGS='-enableAuth'\n```\n\n## Development\n\nWhile developing the `certifier`, we generally run/test the `certifier` locally using `faas-netes`.  The cleanest way to do this is using an throw-away cluster using [KinD](https://github.com/kubernetes-sigs/kind) and [arkade](https://github.com/alexellis/arkade)\n\n```sh\nkind create cluster\narkade install openfaas --basic-auth=false\nkubectl rollout status -n openfaas deploy/gateway\nkubectl port-forward -n openfaas svc/gateway 8080:8080  \u003e /dev/null 2\u003e\u00261 \u0026\n\nexport OPENFAAS_URL=http://127.0.0.1:8080/\nmake test-kubernetes\n```\n\nWhen you are done, you can stop the port-forward and clean up the cluster using\n\n```sh\npkill kubectl\nkind delete cluster\n```\n\n### Running individual tests\n\nThe test suite uses the Go test framework, so we can run individual tests by passing the [`-run` flag](https://golang.org/pkg/testing/#hdr-Subtests_and_Sub_benchmarks).\n\nFor example,\n\n```sh\ngo test -run '^Test_SecretCRUD'\n```\n\nThis is exposed in the `Makefile`,\n\n```sh\nmake test-kubernetes .TEST_FLAGS='-run ^Test_SecretCRUD'\n```\n\n### Test and Feature flags\nSome providers may not implement all features (yet) or an installation may have disabled a feature (e.g. scale to zero using the faas-idler)\n\n```sh\n  -enableAuth\n    \tenable/disable authentication. The auth will be parsed from the default config in ~/.openfaas/config.yml\n  -gateway string\n    \tset the gateway URL, if empty use the gateway_url env variable\n  -enableScaling\n    \tenable/disable scale from zero tests (default true)\n  -secretUpdate\n    \tenable/disable secret update tests (default true)\n  -token string\n    \tauthentication Bearer token override, enables auth automatically\n```\n\nThese flags can be passed the the `Makefile` via the `.FEATURE_FLAGS` variable:\n\n```sh\nmake test-kubernetes .FEATURE_FLAGS='-scaleToZero=false'\n```\n\n## Status\n\nThis is a work-in-progress and attempts to cover the basic scenarios of operating an OpenFaaS provider.\n\nStyle guidelines\n- [ ] Initial versions use idiomatic Go for tests (no asserts or Gherkin)\n- [ ] Duplication is better than premature abstraction / complexity\n- [ ] Tests need to cope with timeouts and attempt retries when that makes sense\n- [ ] should pass `gofmt`\n- [ ] commits should follow contribution guide of [openfaas/faas](https://github.com/openfaas/faas)\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenfaas%2Fcertifier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopenfaas%2Fcertifier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopenfaas%2Fcertifier/lists"}