-
Notifications
You must be signed in to change notification settings - Fork 469
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add fallback for git branch calculation (#871)
In some ci's, the git branch will not be present in the environment with the default that env-ci uses, so we need to provide a fallback. The fallback is either the PR's branch if present or the .git branch. This branch is used inside of the Engine frontend to display more information about the schema changes. See https://github.com/pvdlg/env-ci#caveats for a longer list of cases when the branch will not be present in the ci environment
- Loading branch information
Showing
2 changed files
with
42 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { gitInfo } from "../git"; | ||
|
||
describe("Git integration", () => { | ||
it("Returns commit, branch, message, committer, and remoteUrl", async () => { | ||
// Currently these tests are too granular and would be better as | ||
// service:push tests when they are uncommented | ||
const info = await gitInfo(); | ||
|
||
expect(info.commit).toBeDefined(); | ||
expect(info.committer).toBeDefined(); | ||
expect(info.remoteUrl).toBeDefined(); | ||
expect(info.message).toBeDefined(); | ||
expect(info.branch).toBeDefined(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters