-
Notifications
You must be signed in to change notification settings - Fork 0
Include extra files for quarto #66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| Hello from an extra bundled file. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -46,6 +46,42 @@ def test_resolve_config_reads_deployment_file(tmp_path, monkeypatch): | |
| assert "entrypoint=app:app" in written | ||
|
|
||
|
|
||
| def test_resolve_config_writes_extra_files_as_heredoc(tmp_path, monkeypatch): | ||
| toml_path = tmp_path / DEPLOYMENTS / "app.toml" | ||
| toml_path.parent.mkdir(parents=True) | ||
| toml_path.write_text( | ||
| 'server_url = "https://connect.example.com"\n' | ||
| 'id = "abc-123"\n' | ||
| "[configuration]\n" | ||
| 'entrypoint = "report.qmd"\n' | ||
| 'files = ["/report.qmd", "/helper.py", "/data/input.csv"]\n' | ||
| ) | ||
| output_file = tmp_path / "github_output" | ||
| monkeypatch.chdir(tmp_path) | ||
| monkeypatch.setenv("GITHUB_OUTPUT", str(output_file)) | ||
| monkeypatch.delenv("INPUT_CONNECT_SERVER", raising=False) | ||
| monkeypatch.delenv("INPUT_CONTENT_GUID", raising=False) | ||
| monkeypatch.delenv("INPUT_DEPLOYMENT_FILE", raising=False) | ||
|
|
||
| assert main(["resolve-config"]) == 0 | ||
|
|
||
| written = output_file.read_text() | ||
| # Multi-line outputs use the heredoc form so each file lands on its own line. | ||
| assert "extra_files<<__GHA_EOF__\nhelper.py\ndata/input.csv\n__GHA_EOF__" in written | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. monkeypatch monkeypatch monkeypatch and then this, I have literally no idea what this is testing. Could/should we add an "extra file" to the quarto e2e test that was added in the last PR to confirm? Or would that be too hard to confirm that the deployed thing was right?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can try!
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, I've added an e2e test for this too. I'm going to leave the monkey monkey monkey for now, but we can clean it up if it gets in the way |
||
|
|
||
|
|
||
| def test_resolve_config_empty_extra_files_uses_plain_form(tmp_path, monkeypatch): | ||
| output_file = tmp_path / "github_output" | ||
| monkeypatch.setenv("GITHUB_OUTPUT", str(output_file)) | ||
| monkeypatch.setenv("INPUT_CONNECT_SERVER", "https://connect.example.com") | ||
| monkeypatch.setenv("INPUT_CONTENT_GUID", "guid-123") | ||
| monkeypatch.setenv("INPUT_DEPLOYMENT_FILE", "") | ||
|
|
||
| assert main(["resolve-config"]) == 0 | ||
|
|
||
| assert "extra_files=\n" in output_file.read_text() | ||
|
|
||
|
|
||
| def test_resolve_config_error_exits_nonzero(tmp_path, monkeypatch, capsys): | ||
| monkeypatch.chdir(tmp_path) | ||
| monkeypatch.setenv("GITHUB_OUTPUT", str(tmp_path / "github_output")) | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only for quarto?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just working around a(nother) quirk of how
rsconnect deploy quartois different from the other modes?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically, yeah, the other modes deploy everything under
.already