Skip to content

Commit 4facba1

Browse files
authored
Merge pull request #281 from getappmap/init-empty_20240703
fix: fix NPE running init when no appmap.yml found
2 parents a31bec3 + 3eb8eef commit 4facba1

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ jobs:
3535
distribution: temurin
3636
java-version: ${{ matrix.java }}
3737

38-
- name: Install Bash on macOS
38+
- name: Install extras on macOS
3939
if: runner.os == 'macOS'
40-
run: brew install bash
40+
run: brew install bash sbt
4141

4242
- name: Run Tests
4343
shell: bash

agent/src/main/java/com/appland/appmap/config/AppMapConfig.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ private static Path findConfig(Path configFile, boolean mustExist) throws FileNo
9797
Files.createDirectories(projectDirectory);
9898
Files.write(configFile, getDefault(projectDirectory.toString()).getBytes());
9999

100-
return configFile;
100+
return configFile.toAbsolutePath();
101101
} catch (IOException e) {
102102
logger.error(e, "Failed to create default config");
103103
}

agent/test/agent_cli/agent_cli.bats

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,16 @@ load '../helper'
77
setup_file() {
88
export AGENT_JAR="$(find_agent_jar)"
99

10-
rm -rf test/agent_cli/spring-petclinic
11-
tar -C build/fixtures -c -f - ./spring-petclinic | tar -x -f - -C test/agent_cli
12-
cp -v test/petclinic/appmap.yml test/agent_cli/spring-petclinic/.
10+
TEST_DIR="$BATS_FILE_TMPDIR/agent_cli"
11+
mkdir -p "$TEST_DIR"
12+
rm -rf "$TEST_DIR"/spring-petclinic
1313

14-
cd test/agent_cli
14+
tar -C build/fixtures -c -f - ./spring-petclinic | tar -x -f - -C "$TEST_DIR"
15+
cp -v test/petclinic/appmap.yml "$TEST_DIR"/spring-petclinic/.
16+
17+
tar -c -f - -C test/agent_cli ./sampleproj | tar -x -f - -C "$TEST_DIR"
18+
19+
cd "$TEST_DIR"
1520
_configure_logging
1621

1722
}

0 commit comments

Comments
 (0)