Skip to content

Commit c271058

Browse files
mononoke/integration tests: fix returning different output in OSS cases in tests
Summary: For the tests that output different data to stdout in OSS vs FB create helpers that remove the differences. Differential Revision: D23814134 fbshipit-source-id: f03ffb6501e7d76b457b8cff2b71a116f66b04fe
1 parent 584de33 commit c271058

File tree

6 files changed

+14
-89
lines changed

6 files changed

+14
-89
lines changed

eden/mononoke/tests/integration/library.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ fi
1313

1414
ALLOWED_IDENTITY_TYPE="${FB_ALLOWED_IDENTITY_TYPE:-X509_SUBJECT_NAME}"
1515
ALLOWED_IDENTITY_DATA="${FB_ALLOWED_IDENTITY_DATA:-CN=localhost,O=Mononoke,C=US,ST=CA}"
16+
JSON_CLIENT_ID="${FB_JSON_CLIENT_ID:-[\"X509_SUBJECT_NAME:CN=localhost,O=Mononoke,C=US,ST=CA\"]}"
1617

1718
if [[ -n "$DB_SHARD_NAME" ]]; then
1819
MONONOKE_DEFAULT_START_TIMEOUT=60
@@ -1648,6 +1649,12 @@ function summarize_scuba_json() {
16481649
jq -S "if (.normal.log_tag | match(\"^($interesting_tags)\$\")) then ${key_spec:3} else empty end"
16491650
}
16501651

1652+
if [ -z "$HAS_FB" ]; then
1653+
function format_single_scuba_sample() {
1654+
jq -S .
1655+
}
1656+
fi
1657+
16511658
function regenerate_hg_filenodes() {
16521659
"$MONONOKE_REGENERATE_HG_FILENODES" \
16531660
"${COMMON_ARGS[@]}" \

eden/mononoke/tests/integration/run_tests_getdeps.py

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,6 @@ def get_test_groups(repo_root):
121121
"test-walker-count-objects.t",
122122
"test-walker-error-as-data.t",
123123
},
124-
TestGroup.BROKEN: {
125-
"test-fastreplay-inline-args.t", # Returns different data in OSS
126-
"test-remotefilelog-lfs-client-certs.t", # Returns different data in OSS
127-
"test-server.t", # Returns different data in OSS
128-
"test-unbundle-replay-hg-recording.t", # Returns different data in OSS
129-
},
130124
}
131125

132126
if platform == "darwin":

eden/mononoke/tests/integration/test-fastreplay-inline-args.t

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Test a few more options
4343
Replay Succeeded
4444

4545
Check logging structure
46-
$ grep "Replay Succeeded" "$fastreplay_log" | grep gettreepack | head -n 1 | jq .
46+
$ grep "Replay Succeeded" "$fastreplay_log" | grep gettreepack | head -n 1 | format_single_scuba_sample
4747
{
4848
"int": {
4949
"completion_time_us": *, (glob)
@@ -57,15 +57,12 @@ Check logging structure
5757
"time": * (glob)
5858
},
5959
"normal": {
60-
"build_revision": *, (glob)
61-
"build_rule": *, (glob)
6260
"command": "gettreepack",
6361
"command_args": "[{\"basemfnodes\":\"\",\"depth\":\"65536\",\"directories\":\"\",\"mfnodes\":\"7c9b4fd8b49377e2fead2e9610bb8db910a98c53\",\"rootdir\":\"\"}]",
6462
"log_tag": "Replay Succeeded",
6563
"recorded_mononoke_session_id": *, (glob)
6664
"recorded_server": "mononoke",
6765
"reponame": "repo",
68-
"server_hostname": * (glob)
6966
}
7067
}
7168

eden/mononoke/tests/integration/test-remotefilelog-lfs-client-certs.t

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,8 @@ Now, remove the killswitch. This will work
5858
Finally, check what identities the client presented.
5959

6060
$ wait_for_json_record_count "$TESTTMP/scuba.json" 2
61-
$ jq -S .normvector.client_identities "$TESTTMP/scuba.json"
62-
[
63-
"MACHINE:devvm000.lla0.facebook.com",
64-
"MACHINE_TIER:devvm",
65-
"USER:myusername0"
66-
]
67-
[
68-
"MACHINE:devvm000.lla0.facebook.com",
69-
"MACHINE_TIER:devvm",
70-
"USER:myusername0"
71-
]
61+
$ diff <(
62+
> jq -S .normvector.client_identities "$TESTTMP/scuba.json"
63+
> ) <(
64+
> printf "$JSON_CLIENT_ID\n$JSON_CLIENT_ID" | jq -S .
65+
> )

eden/mononoke/tests/integration/test-server.t

Lines changed: 0 additions & 64 deletions
This file was deleted.

eden/mononoke/tests/integration/test-unbundle-replay-hg-recording.t

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Check history again. We're back to where we were:
9090
(master_bookmark) 7a8f33ce453248a6f5cc4747002e931c77234fbd pushrebase * (glob)
9191
(master_bookmark) 26805aba1e600a82e93661149f2313866a221a7b blobimport * (glob)
9292

93-
$ jq -S . < $TESTTMP/scuba.json
93+
$ format_single_scuba_sample < $TESTTMP/scuba.json
9494
{
9595
"int": {
9696
"age_s": *, (glob)
@@ -105,10 +105,7 @@ Check history again. We're back to where we were:
105105
},
106106
"normal": {
107107
"bookmark": "master_bookmark",
108-
"build_revision": *, (glob)
109-
"build_rule": "fbcode:eden/mononoke/unbundle_replay:unbundle_replay",
110108
"from_cs_id": "c3384961b16276f2db77df9d7c874bbe981cf0525bd6f84a502f919044f2dabd",
111-
"server_hostname": *, (glob)
112109
"to_cs_id": "604bc07f395768cd320516a640bef6a1af75d13b4214d44ae3faa2a36f1203bb"
113110
}
114111
}

0 commit comments

Comments
 (0)