test cases are wip

pull/47/head
Stephen Kirby 2 years ago
parent ca1d4547cb
commit 7db44a39bf

Binary file not shown.

After

Width:  |  Height:  |  Size: 82 KiB

@ -15,26 +15,32 @@ Runs a script that checks for stored Git credentials `user.name` and `user.email
### Using workspace owner
The credentials can be populated from the workspace owner's information.
The default credentials can be populated from the workspace owner's information.
```hcl
module "git-config" {
source = "https://registry.coder.com/modules/git-config"
agent_id = coder_agent.example.id
username = data.coder_workspace.me.owner
user_email = data.coder_workspace.me.owner_email
default_username = data.coder_workspace.me.owner
default_user_email = data.coder_workspace.me.owner_email
}
```
### Custom credentials
Credentials can also be set manually.
Credentials can also be set manually by the template admin.
```hcl
module "git-config" {
source = "https://registry.coder.com/modules/git-config"
agent_id = coder_agent.example.id
username = "michael"
default_username = "michael"
user_email = "michael@example.com"
}
```
## Coder parameter usage
With the defaults set, users still have the opportunity to override the template admin's settings with the coder parameter interface. The workspace owner can manually add their credentials during workspace creation or leave them as "default".
![Coder Parameter Example](../.images/git-config-params.png)

@ -11,15 +11,19 @@ describe("git-config", async () => {
testRequiredVariables(import.meta.dir, {
agent_id: "foo",
default_user_email: 's@example.tld',
default_username: 'example username',
});
it("fails without git", async () => {
const state = await runTerraformApply(import.meta.dir, {
agent_id: "foo",
default_user_email: 's@example.tld',
default_username: 'example username',
});
const output = await executeScriptInContainer(state, "alpine");
expect(output.exitCode).toBe(1);
expect(output.stdout).toEqual(["Git is not installed!"]);
expect(output.stdout).toEqual(["\u001B[0;1mChecking git-config!", "Git is not installed!"]);
});
// it("runs with git", async () => {

Loading…
Cancel
Save