Skip to content

Commit 0f7c7db

Browse files
DinoVmeta-codesync[bot]
authored andcommitted
Update expected tests on pyimport
Summary: Amongst the other failures D90224863 had a failure due to a new test being added. We should just auto-update the tests on import. Reviewed By: itamaro Differential Revision: D90268060 fbshipit-source-id: 8dc365cc26dbe31abf29f7124c6259749d2171d4
1 parent 5ea9468 commit 0f7c7db

File tree

3 files changed

+48
-28
lines changed

3 files changed

+48
-28
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#!/bin/bash
2+
3+
# Generate what should be the current contents of the tests.bzl file and write
4+
# it out to $1.
5+
6+
set -e
7+
8+
if [ -z "$1" ]; then echo "Usage: $0 <output_file>"; exit 1; fi
9+
10+
echo Generate 3.10
11+
buck run fbcode//cinderx:ctl3.10 > /tmp/3.10.txt
12+
echo Generate 3.12
13+
buck run fbcode//cinderx:ctl3.12 > /tmp/3.12.txt
14+
echo Generate 3.14
15+
buck run fbcode//cinderx:ctl3.14 > /tmp/3.14.txt
16+
echo Generate 3.15
17+
buck run fbcode//cinderx:ctl3.15 > /tmp/3.15.txt
18+
19+
{
20+
echo "TESTS = {"
21+
echo \"3.10\":
22+
cat /tmp/3.10.txt
23+
echo ","
24+
echo \"3.12\":
25+
cat /tmp/3.12.txt
26+
echo ","
27+
echo \"3.14\":
28+
cat /tmp/3.14.txt
29+
echo ","
30+
echo \"3.15\":
31+
cat /tmp/3.15.txt
32+
echo "}"
33+
} > "$1"
34+
pyfmt "$1"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
# Verify that the tests.bzl file is up to date and accounts for all of the CPython and cinder tests.
4+
# If the tests diff you can re-run this and cp /tmp/tests.txt to cinderx/tests.bzl
5+
6+
set -e
7+
8+
cd "$(dirname "$(readlink -f "$0")")"
9+
10+
./gen_test_defs.sh "$(pwd)/../tests.bzl"
Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,12 @@
11
#!/bin/bash
22

33
# Verify that the tests.bzl file is up to date and accounts for all of the CPython and cinder tests.
4-
# If the tests diff you can re-run this and cp /tmp/tests.txt to cinderx/tests.bzl
4+
# If the tests diff you can run regen_test_defs.sh to update it.
55

66
set -e
77

8-
cd "$(dirname "$(readlink -f "$0")")"/../
8+
cd "$(dirname "$(readlink -f "$0")")"
99

10-
echo Generate 3.10
11-
buck run fbcode//cinderx:ctl3.10 > /tmp/3.10.txt
12-
echo Generate 3.12
13-
buck run fbcode//cinderx:ctl3.12 > /tmp/3.12.txt
14-
echo Generate 3.14
15-
buck run fbcode//cinderx:ctl3.14 > /tmp/3.14.txt
16-
echo Generate 3.15
17-
buck run fbcode//cinderx:ctl3.15 > /tmp/3.15.txt
10+
./gen_test_defs.sh /tmp/tests.txt
1811

19-
{
20-
echo "TESTS = {"
21-
echo \"3.10\":
22-
cat /tmp/3.10.txt
23-
echo ","
24-
echo \"3.12\":
25-
cat /tmp/3.12.txt
26-
echo ","
27-
echo \"3.14\":
28-
cat /tmp/3.14.txt
29-
echo ","
30-
echo \"3.15\":
31-
cat /tmp/3.15.txt
32-
echo "}"
33-
} > /tmp/tests.txt
34-
pyfmt /tmp/tests.txt
35-
36-
diff /tmp/tests.txt tests.bzl
12+
diff /tmp/tests.txt ../tests.bzl

0 commit comments

Comments
 (0)