Skip to content

Commit f3b80fb

Browse files
fix tests after f2a8adb change
1 parent 64be343 commit f3b80fb

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

test/test.ml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,12 @@ let get_mock_slack_events () =
3232
let process_gh_payload ~(secrets : Config_t.secrets) ~config (kind, path, state_path) =
3333
let headers = [ "x-github-event", kind ] in
3434
let make_test_context event =
35-
let repo = Github.repo_of_notification @@ Github.parse_exn headers event in
35+
let ctx = Context.make () in
36+
let get_build_branch = Api_local.Buildkite.get_build_branch ~ctx in
37+
let%lwt n = Github.parse_exn headers event ~get_build_branch in
38+
let repo = Github.repo_of_notification n in
3639
(* overwrite repo url in secrets with that of notification for this test case *)
3740
let secrets = { secrets with repos = [ { url = repo.url; gh_token = None; gh_hook_secret = None } ] } in
38-
let ctx = Context.make () in
3941
ctx.secrets <- Some secrets;
4042
let (_ : State_t.repo_state) = State.find_or_add_repo ctx.state repo.url in
4143
let () =
@@ -48,13 +50,13 @@ let process_gh_payload ~(secrets : Config_t.secrets) ~config (kind, path, state_
4850
Context.set_repo_config ctx repo.url config
4951
| exception exn -> log#error ~exn "failed to load state from file %s" state_path
5052
in
51-
ctx
53+
Lwt.return ctx
5254
in
5355
Printf.printf "===== file %s =====\n" path;
5456
let headers = [ "x-github-event", kind ] in
5557
match Std.input_file path with
5658
| event ->
57-
let ctx = make_test_context event in
59+
let%lwt ctx = make_test_context event in
5860
Action_local.process_github_notification ctx headers event
5961
| exception exn ->
6062
log#error ~exn "failed to read file %s" path;

0 commit comments

Comments
 (0)