Skip to content

Commit 9e80f21

Browse files
committed
[tooling] Fix test script for all OS
1 parent b13523c commit 9e80f21

File tree

2 files changed

+13
-26
lines changed

2 files changed

+13
-26
lines changed

README.md

Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,3 @@
11
# exercises
22

3-
## Git-Mastery exercise structure
4-
5-
When you download an exercise, you will get the following folder structure:
6-
7-
8-
## `.gitmastery-exercise.json`
9-
10-
Configuration fields for each exercise:
11-
12-
1. `exercise_name`: name of exercise
13-
2. `tags`: list of tags for exercise
14-
3. `requires_git`: downloading the exercise will check that Git is installed and that `git config` is already done
15-
4. `requires_github`: downloading the exercise will check that Github and Github CLI is installed
16-
5. `base_files`: provides the files to be included outside of the repository, along with `.gitmastery-exercise.json` and `README.md`, most often used for `answers.txt`
17-
6. `exercise_repo`: configuration for what the exercise repository would look like
18-
1. `repo_type`: `local` (creates and initializes the folder as a Git repository) or `remote` (reference a repository on Github)
19-
2. `repo_name`: name of repository during cloning
20-
3. `repo_title`: (only read if `link` is present) link of repository on Github
21-
4. `create_fork`: (only read if `link` is present) flag to determine if we need to fork the repository to the student's machine, otherwise it just clones the repository
22-
5. `init`: (only read if `custom` is present) flag to determine if we will call `git init` on the exercise repository (useful if we don't want to start out with a Git repository)
23-
24-
25-
## TODOs
26-
27-
- [X] Add validation for exercise configuration (e.g. cannot fork + not require Github) - to run as CI
3+
For more details, refer to the official developer documentation: https://git-mastery.github.io/developers

test.sh

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,16 @@
11
#!/bin/bash
2+
set -e
23

3-
source venv/bin/activate
4+
if [ -f "venv/bin/activate" ]; then
5+
# Linux / macOS
6+
source venv/bin/activate
7+
elif [ -f "venv/Scripts/activate" ]; then
8+
# Windows (Git Bash, Cygwin, or WSL)
9+
source venv/Scripts/activate
10+
else
11+
echo "Error: Could not find Python virtual environment activation script."
12+
echo "Please create one with: python -m venv venv"
13+
exit 1
14+
fi
415

516
python -m pytest $1/tests/test_verify.py -s -vv

0 commit comments

Comments
 (0)