Skip to content

Commit f013ab4

Browse files
authored
fix: remove DRY_RUN env var and --dry-run flag (#210)
Free the DRY_RUN env var name to be used for other purposes by function authors. The original intent of the DRY_RUN was to be used at build time for GCF to validate function syntax without starting the server, but this was never implemented. For local testing purposes, simply starting the functions framework server is a better method.
1 parent 0ced0d2 commit f013ab4

File tree

3 files changed

+2
-21
lines changed

3 files changed

+2
-21
lines changed

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,6 @@ You can configure the Functions Framework using command-line flags or environmen
322322
| `--signature-type` | `FUNCTION_SIGNATURE_TYPE` | The signature used when writing your function. Controls unmarshalling rules and determines which arguments are used to invoke your function. Default: `http`; accepted values: `http`, `event` or `cloudevent` |
323323
| `--source` | `FUNCTION_SOURCE` | The path to the file containing your function. Default: `main.py` (in the current working directory) |
324324
| `--debug` | `DEBUG` | A flag that allows to run functions-framework to run in debug mode, including live reloading. Default: `False` |
325-
| `--dry-run` | `DRY_RUN` | A flag that allows for testing the function build from the configuration without creating a server. Default: `False` |
326325

327326
## Enable Google Cloud Function Events
328327

src/functions_framework/_cli.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,6 @@
3232
@click.option("--host", envvar="HOST", type=click.STRING, default="0.0.0.0")
3333
@click.option("--port", envvar="PORT", type=click.INT, default=8080)
3434
@click.option("--debug", envvar="DEBUG", is_flag=True)
35-
@click.option("--dry-run", envvar="DRY_RUN", is_flag=True)
36-
def _cli(target, source, signature_type, host, port, debug, dry_run):
35+
def _cli(target, source, signature_type, host, port, debug):
3736
app = create_app(target, source, signature_type)
38-
if dry_run:
39-
click.echo("Function: {}".format(target))
40-
click.echo("URL: http://{}:{}/".format(host, port))
41-
click.echo("Dry run successful, shutting down.")
42-
else:
43-
create_server(app, debug).run(host, port)
37+
create_server(app, debug).run(host, port)

tests/test_cli.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -69,18 +69,6 @@ def test_cli_no_arguments():
6969
[pretend.call("foo", None, "event")],
7070
[pretend.call("0.0.0.0", 8080)],
7171
),
72-
(
73-
["--target", "foo", "--dry-run"],
74-
{},
75-
[pretend.call("foo", None, "http")],
76-
[],
77-
),
78-
(
79-
[],
80-
{"FUNCTION_TARGET": "foo", "DRY_RUN": "True"},
81-
[pretend.call("foo", None, "http")],
82-
[],
83-
),
8472
(
8573
["--target", "foo", "--host", "127.0.0.1"],
8674
{},

0 commit comments

Comments
 (0)