Skip to content

Commit 19ad2fc

Browse files
authored
AXON-760: Configured git repository for Bitbucket simulation (#645)
* AXON-760: Configured git repository for Bitbucket simulation * AXON-760: Configured git repository for Bitbucket simulation
1 parent 4dfc016 commit 19ad2fc

File tree

3 files changed

+53
-7
lines changed

3 files changed

+53
-7
lines changed

e2e/Dockerfile

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,6 @@ RUN curl -fsSL https://code-server.dev/install.sh -o install-code-server.sh \
1717
# otherwise tsc might generate wrong paths for e2e tests
1818
WORKDIR /atlascode
1919

20-
RUN mkdir /mock-repository && cd /mock-repository \
21-
&& git init \
22-
&& git remote add origin [email protected]/test-repository.git \
23-
&& touch test.json \
24-
&& cd ..
25-
2620
# Where our vscode, chromedriver, images etc. will go
2721
ENV TEST_RESOURCES=/atlascode/e2e/.resources
2822

@@ -33,6 +27,11 @@ RUN cat <<EOF > /usr/bin/entrypoint.sh && chmod +x /usr/bin/entrypoint.sh
3327
#!/usr/bin/env bash
3428
set -ex
3529

30+
#Setting up git configuration
31+
echo "Running git setup script..."
32+
chmod +x ./e2e/setup-mock-repository.sh
33+
./e2e/setup-mock-repository.sh
34+
3635
echo "setting up trusted certificate authorities"
3736
cp ./e2e/sslcerts/rootCA.crt /usr/local/share/ca-certificates/atlascode_e2e_Root_CA.crt
3837
update-ca-certificates

e2e/setup-mock-repository.sh

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/bin/bash
2+
set -e
3+
4+
echo "Setting up global git configuration..."
5+
git config --global user.name "Test User"
6+
git config --global user.email "[email protected]"
7+
git config --global init.defaultBranch main
8+
9+
echo "Creating mock repository that simulates a Bitbucket clone..."
10+
mkdir /mock-repository
11+
cd /mock-repository
12+
13+
# Initialize repository
14+
git init
15+
16+
# Add remote and configure it properly (like git clone does)
17+
git remote add origin [email protected]/test-repository.git
18+
git config branch.main.remote origin
19+
git config branch.main.merge refs/heads/main
20+
git config remote.origin.fetch "+refs/heads/*:refs/remotes/origin/*"
21+
22+
# Create initial files
23+
touch test.json README.md
24+
echo "# Test Repository" > README.md
25+
echo "{}" > test.json
26+
27+
# Commit files and set up tracking
28+
git add .
29+
git commit -m "Initial commit"
30+
git branch -M main
31+
32+
# Simulate remote tracking (like after clone + fetch)
33+
git update-ref refs/remotes/origin/main refs/heads/main
34+
35+
echo "Creating test branch with additional commits..."
36+
# Create and switch to test branch
37+
git checkout -b test-branch
38+
39+
# Add some changes to simulate development work
40+
echo "Test feature implementation" >> README.md
41+
echo '{"name": "test-project", "version": "1.0.0"}' > test.json
42+
43+
# Commit the changes
44+
git add .
45+
git commit -m "Add test feature with script.js and updated files"
46+
47+
cd ..

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"test:react": "jest -c jest.react.config.ts",
6767
"test:e2e:sslcerts": "cd e2e/sslcerts && ./generate-certs.sh",
6868
"test:e2e:docker": "cd e2e && docker compose run --rm atlascode-e2e; status=$?; docker compose down; exit $status",
69-
"test:e2e:docker:build": "docker build --tag atlascode-e2e - <e2e/Dockerfile",
69+
"test:e2e:docker:build": "docker build --tag atlascode-e2e -f e2e/Dockerfile .",
7070
"test:e2e:docker:serve": "cd e2e && npm run test:e2e:docker:build && export ONLYSERVER=1 && docker compose up",
7171
"devcompile": "npm run clean && npm run devcompile:react && npm run devcompile:extension",
7272
"devcompile:react": "webpack --mode development --config webpack.react.dev.js --fail-on-warnings",

0 commit comments

Comments
 (0)