|
2 | 2 | just --list --unsorted |
3 | 3 |
|
4 | 4 | @_checks: check-spelling check-commits |
5 | | -@_tests: test |
| 5 | +@_tests: (test "true") (test "false") |
6 | 6 | @_builds: build-contributors build-website build-readme |
7 | 7 |
|
8 | 8 | # Run all build-related recipes in the justfile |
@@ -44,62 +44,14 @@ check-commits: |
44 | 44 | check-spelling: |
45 | 45 | uvx typos |
46 | 46 |
|
47 | | -# Test and check that a data package can be created from the template |
48 | | -test: |
49 | | - #!/usr/bin/env bash |
50 | | - test_name="test-data-package" |
51 | | - test_dir="$(pwd)/_temp/$test_name" |
52 | | - template_dir="$(pwd)" |
53 | | - commit=$(git rev-parse HEAD) |
54 | | - rm -rf $test_dir |
55 | | - # vcs-ref means the current commit/head, not a tag. |
56 | | - uvx copier copy $template_dir $test_dir \ |
57 | | - --vcs-ref=$commit \ |
58 | | - --defaults \ |
59 | | - --trust \ |
60 | | - --data github_repo=$test_name \ |
61 | | - --data github_user="first-last" \ |
62 | | - --data author_given_name="First" \ |
63 | | - --data author_family_name="Last" \ |
64 | | - --data author_email="first.last@example.com" \ |
65 | | - --data review_team="@first-last/developers" \ |
66 | | - --data cc0_license="true" \ |
67 | | - --data github_board_number=22 |
68 | | - # Run checks in the generated test data package |
69 | | - cd $test_dir |
70 | | - git add . |
71 | | - git commit -m "test: initial copy" |
72 | | - just check-python check-spelling |
73 | | - # TODO: Find some way to test the `update` command |
74 | | - # Check that recopy works |
75 | | - echo "Testing recopy command -----------" |
76 | | - rm .cz.toml |
77 | | - git add . |
78 | | - git commit -m "test: preparing to recopy from the template" |
79 | | - uvx copier recopy \ |
80 | | - --vcs-ref=$commit \ |
81 | | - --defaults \ |
82 | | - --overwrite \ |
83 | | - --trust |
84 | | - # Check that copying onto an existing data package works |
85 | | - echo "Using the template in an existing package command -----------" |
86 | | - rm .cz.toml .copier-answers.yml LICENSE-MIT.md LICENSE.md |
87 | | - git add . |
88 | | - git commit -m "test: preparing to copy onto an existing package" |
89 | | - uvx copier copy \ |
90 | | - $template_dir $test_dir \ |
91 | | - --vcs-ref=$commit \ |
92 | | - --defaults \ |
93 | | - --trust \ |
94 | | - --overwrite \ |
95 | | - --data github_repo=$test_name \ |
96 | | - --data github_user="first-last" \ |
97 | | - --data author_given_name="First" \ |
98 | | - --data author_family_name="Last" \ |
99 | | - --data author_email="first.last@example.com" \ |
100 | | - --data review_team="@first-last/developers" \ |
101 | | - --data cc0_license="false" \ |
102 | | - --data github_board_number=22 |
| 47 | +# Test that a data package can be created from the template |
| 48 | +test cc0_license="true": |
| 49 | + sh ./test-template.sh {{ cc0_license }} |
| 50 | + |
| 51 | +# Test template with the manual questionnaire answers |
| 52 | +test-manual: |
| 53 | + mkdir -p _temp/manual |
| 54 | + uvx copier copy --trust -r HEAD . _temp/manual/test-template |
103 | 55 |
|
104 | 56 | # Clean up any leftover and temporary build files |
105 | 57 | cleanup: |
|
0 commit comments